rofl90 Posted March 6, 2008 Share Posted March 6, 2008 OK heres the deal, I've made this CMS, but if you get timed out of the system, it goes to the login screen, I need to like check the referrer and if the referrer has like the prefix http://www.xxx.com/backend/somepage.php the header goes to somepage.php if not and its a new login it goes to index2.php how wpould I go about doing that w/o javascript if possible. Quote Link to comment Share on other sites More sharing options...
amites Posted March 6, 2008 Share Posted March 6, 2008 you probably want to use $_SERVER['HTTP_REFERER'] try taking a look at <?php print_r(get_defined_vars()); ?> sometime, give you an idea of what all variables you have to work with are Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 7, 2008 Author Share Posted March 7, 2008 but i need to analyse that http-referrer to be like http://www.example.com/ without the trailing stuff eg http://www.example.com/go/contact/me/contact.php Quote Link to comment Share on other sites More sharing options...
notanoob Posted March 7, 2008 Share Posted March 7, 2008 but i need to analyse that http-referrer to be like http://www.example.com/ without the trailing stuff eg Use string search to find position of 3rd slash and then do a substring from 0 to that position. Then do your comparison on that substring. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 7, 2008 Author Share Posted March 7, 2008 Not all too familiar with that, could I get a function link. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 7, 2008 Author Share Posted March 7, 2008 /bump. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.