TheFilmGod Posted January 11, 2008 Share Posted January 11, 2008 How do I use php to find the full address of the page the user is on? I don't need the http://www.yoursite.com stuff Only what comes after the ".com" like /elements/script_one.php or /photos/cool_stuff.php Thanks! Link to comment https://forums.phpfreaks.com/topic/85567-page-address/ Share on other sites More sharing options...
p2grace Posted January 11, 2008 Share Posted January 11, 2008 Try this: echo $_SERVER['REQUEST_URI']; Link to comment https://forums.phpfreaks.com/topic/85567-page-address/#findComment-436681 Share on other sites More sharing options...
Ken2k7 Posted January 11, 2008 Share Posted January 11, 2008 Try this: echo $_SERVER['REQUEST_URI']; Note the code above also gets something like: /page.php?blah=true. If you want just /page.php, you want: echo $_SERVER['PHP_SELF']; Link to comment https://forums.phpfreaks.com/topic/85567-page-address/#findComment-436852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.