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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -