centerwork Posted September 7, 2008 Share Posted September 7, 2008 I have looked all over and I can seem to find anything on this topic. Here is what I am looking to do. 1) Pull out what is in the users address bar. 2) Pull out what page the user is on without having to pass a variable from the previous page. Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/123123-solved-what-is-in-the-user-address-bar-amp-what-page-is-the-user-on/ Share on other sites More sharing options...
GingerRobot Posted September 7, 2008 Share Posted September 7, 2008 Any information like that is contained within the $_SERVER superglobal. Try taking a look at it: echo '<pre>'.print_r($_SERVER,1).'</pre>'; Link to comment https://forums.phpfreaks.com/topic/123123-solved-what-is-in-the-user-address-bar-amp-what-page-is-the-user-on/#findComment-635916 Share on other sites More sharing options...
tibberous Posted September 7, 2008 Share Posted September 7, 2008 2) Pull out what page the user is on without having to pass a variable from the previous page. mod_rewrite It's hard. Link to comment https://forums.phpfreaks.com/topic/123123-solved-what-is-in-the-user-address-bar-amp-what-page-is-the-user-on/#findComment-635921 Share on other sites More sharing options...
GingerRobot Posted September 7, 2008 Share Posted September 7, 2008 How on earth does mod_rewrite have anything to do with what page you are on? Link to comment https://forums.phpfreaks.com/topic/123123-solved-what-is-in-the-user-address-bar-amp-what-page-is-the-user-on/#findComment-635927 Share on other sites More sharing options...
centerwork Posted September 7, 2008 Author Share Posted September 7, 2008 I was able to get the page using the following code. $sess_id = $_SESSION[$sessVar]; //Pulls Out Page from Address Bar $url = $_SERVER['PATH_INFO']; $pattern = "(/admin/)"; $page = preg_replace ($pattern , ' ' , $url); $page = trim($page); Link to comment https://forums.phpfreaks.com/topic/123123-solved-what-is-in-the-user-address-bar-amp-what-page-is-the-user-on/#findComment-636112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.