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 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 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 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. 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
Archived
This topic is now archived and is closed to further replies.