vividona Posted January 7, 2010 Share Posted January 7, 2010 Hi friends, I have 2 simple questions 1. how can I print url where my simple script is installed 2. how can I print directory where my current files is uploaded to. many thanks Link to comment https://forums.phpfreaks.com/topic/187565-about-url-and-dir/ Share on other sites More sharing options...
JAY6390 Posted January 7, 2010 Share Posted January 7, 2010 I don't think "Simple" quite covers your questions. You need to provide info as to what exactly you mean. I could say 1 = echo 'http://www.yoursite.com'; and 2 = echo '/home/username/www/'; but I highly doubt that is what you mean Link to comment https://forums.phpfreaks.com/topic/187565-about-url-and-dir/#findComment-990304 Share on other sites More sharing options...
ignace Posted January 7, 2010 Share Posted January 7, 2010 print 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; print nl2br("\n"); print dirname(__FILE__); Link to comment https://forums.phpfreaks.com/topic/187565-about-url-and-dir/#findComment-990409 Share on other sites More sharing options...
JAY6390 Posted January 7, 2010 Share Posted January 7, 2010 print nl2br("\n"); Surely print '<br />'; would be easier? That's a very strange way of going about that Link to comment https://forums.phpfreaks.com/topic/187565-about-url-and-dir/#findComment-990410 Share on other sites More sharing options...
ignace Posted January 7, 2010 Share Posted January 7, 2010 A bad habit I guess mostly use it in conjunction with content negotiation Link to comment https://forums.phpfreaks.com/topic/187565-about-url-and-dir/#findComment-990422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.