gaurav Posted April 13, 2009 Share Posted April 13, 2009 I am totally new in php. I am building a web site that has user id and password necessary for every work. now the problem if a user give a direct url of addcontent page for which login is necessary in my case user is getting that page directly but what i want , first user will get a login page then he will be directed to addcontent page please help me out gaurav Quote Link to comment https://forums.phpfreaks.com/topic/153884-solved-url/ Share on other sites More sharing options...
ober Posted April 13, 2009 Share Posted April 13, 2009 Store a "logged in" variable in your session or cookie (wherever you store you login info). If the user is not logged in, redirect (header) the user to the login page and store the link they were going to in a field on the login form. When they login, redirect them again to the page they were going to. Quote Link to comment https://forums.phpfreaks.com/topic/153884-solved-url/#findComment-808765 Share on other sites More sharing options...
gaurav Posted April 13, 2009 Author Share Posted April 13, 2009 Hi, Thanks for getting back early. I was however trying to ask a different question, as how to get the original URL which was typed in by the user. I got the solution in form of PHP variable $_SERVER['HTTP_REFERER']. Thanks Again, Gaurav Quote Link to comment https://forums.phpfreaks.com/topic/153884-solved-url/#findComment-808777 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.