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
https://forums.phpfreaks.com/topic/151947-proper-redirection/
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
https://forums.phpfreaks.com/topic/151947-proper-redirection/#findComment-798079
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
https://forums.phpfreaks.com/topic/151947-proper-redirection/#findComment-798094
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.