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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -