Jump to content

proper redirection


contra10

Recommended Posts

I'm trying to attempt to redirect someone from an email to a specific page. the problem is in my header file, if no cookie is set becasue it is a login system, the person gets redirected to the main page. How can i set up a login system where after the person enters their username etc then they can redirected to the page that the email linked them to?

Link to comment
Share on other sites

if the page you are trying to send them to via a link in an email requires authentication, then they will be redirected every time .. otherwise, just change your header() to what you would like it to be .. or, be a little more specific as to what it is you are attempting to attempt to try.

Link to comment
Share on other sites

1. Check the page that they went to, if they are not logged in, create a session or cookie of the exact url they are at.

2. Redirect them to the login page.

3. Place the url from the cookie or session in a hidden field.

4. When the user logs in, check what is in the hidden field, if it is a url, direct them there otherwise direct them to the default page.

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.

Guest
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.