how can i get http://www value in php -
i want save whole url in database domain name using
=$_server["server_name"]
but how can along http://www
don't forget running on possible non standard ports. , test see if request done through https, don't test port numbers determine ssl.
$uri = "http".($_server['https']?'s':'')."://".$_server['server_name'].(($_server['https']&&$_server['server_port']!='443')||(!$_server['https']&&$_server['server_port']!='80')?":".$_server['server_port']:"").$_server['request_uri'];
Comments
Post a Comment