Jump to content



Recommended Posts

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



Link to comment
Share on other sites

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.

Link to comment
Share on other sites



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,


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.