HoTDaWg Posted May 13, 2007 Share Posted May 13, 2007 hiya, what is the difference between .../folder/file.php and $_SERVER['PHP_SELF']/file.php i was also wondering if there was a some sort of way to state the FULL adress of the current site, like this: http://www.example.com/folder/file.php thanks HoTDaWg Quote Link to comment https://forums.phpfreaks.com/topic/51206-need-help-picking-best-method/ Share on other sites More sharing options...
neel_basu Posted May 13, 2007 Share Posted May 13, 2007 $_SERVER['PHP_SELF'] = The full location + Name of the File e.g. Including file.php Use echo $_SERVER['PHP_SELF'] To test it Quote Link to comment https://forums.phpfreaks.com/topic/51206-need-help-picking-best-method/#findComment-252207 Share on other sites More sharing options...
marf Posted May 13, 2007 Share Posted May 13, 2007 In answer to your second question, $_SERVER['HTTP_HOST'] returns the domain. So if you wanted a link $link= "http://".$_SERVER['HTTP_HOST']; echo $link; // Would display http://www.phpfreaks.com Quote Link to comment https://forums.phpfreaks.com/topic/51206-need-help-picking-best-method/#findComment-252274 Share on other sites More sharing options...
boo_lolly Posted May 13, 2007 Share Posted May 13, 2007 just a side note: $_SERVER predefined variables aren't very secure depending on how you're integrating it into your application. Quote Link to comment https://forums.phpfreaks.com/topic/51206-need-help-picking-best-method/#findComment-252352 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.