php - $SERVER variable and the double localhost -
i've built function links excerpt relative post. in order have figured variable $_server['server_name']
come in handy in building path.
i don't know if due fact testing page on local environment, on local machine path have http://localhost/webdir/localhost/index.php?p=3
localhost
repeated twice. possibly cause this?
use this
$link='http://'.$server_['server_name'];
and if don't want type of value use this
$l1=explode('?',$server_['server_name']); $link='http://'.$l1[0];
hope you.
Comments
Post a Comment