karthikeyan_coder Posted January 16, 2007 Share Posted January 16, 2007 hello,i have an urlfor examplehttp://xxx.xxx.222.22/helpdesk/cp/login.php?PHPSESSID=672bbd0810bbdf4c3adb149201736dedif i am in login.php then i need $current;$current == /cp/login.phpi am in IIS.. so you know that $_SERVER['DOCUMENT_ROOT']; wont workand one more clue is... i need a string that comes after first "/helpdesk" and before first "?"if url ishttp://xxx.xxx.222.22/helpdesk/cp/cann/add.php?PHPSESSID=672bbd0810bbdf4c3adb149201736dedthen $current == "/cp/cann/add.php"any ideas? thanks in advance :) Link to comment https://forums.phpfreaks.com/topic/34371-cutting-dir-and-filename-from-a-url/ Share on other sites More sharing options...
trq Posted January 16, 2007 Share Posted January 16, 2007 [quote]i am in IIS.. so you know that $_SERVER['DOCUMENT_ROOT']; wont work[/quote]That makes no sense.Take a look at [url=http://php.net/parse_url]parse_url[/url]. Link to comment https://forums.phpfreaks.com/topic/34371-cutting-dir-and-filename-from-a-url/#findComment-161740 Share on other sites More sharing options...
karthikeyan_coder Posted January 16, 2007 Author Share Posted January 16, 2007 thanks for parse_url ...Posted by mistake Document_root Link to comment https://forums.phpfreaks.com/topic/34371-cutting-dir-and-filename-from-a-url/#findComment-161746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.