Proper Redirect | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Proper Redirect

I'm creating a registeration system using HTML and PHP. It is splitted into three pages, 1. Email and Password confirmation 2. General Details 3. Selecting Username and Profile picture Now my question is, If any user completed the first page and suddenly closes browser without going to other pages, and trying to login with details entered in first page, he/she don't need to go for login page, instead they need to go to second page of Registration....!! How to do this, I need the concept! Thanks in advanc

22nd Jun 2018, 7:39 AM
Hemath Kumar
Hemath Kumar - avatar
7 Answers
+ 16
1. I would recommend you to gather all this information on one page. 2. If you still want to implement registration like this, I would recommend you to use cookies. Save the information about the registration. If a user goes to your website, check his cookies. If registration was not completed redirect him to the page where he stopped by using the following function: header('Location: http://yourwebsite.com/page-which-user-ignored') ;
22nd Jun 2018, 8:53 AM
Igor Makarsky
Igor Makarsky - avatar
+ 15
Hemath Kumar of course the link doesn't work, because it is an example of your link 😁. I just wanted to show you how to use the header() function to redirect users to any page.
22nd Jun 2018, 10:08 AM
Igor Makarsky
Igor Makarsky - avatar
+ 1
in case of browser closing he/she have to manually change page
22nd Jun 2018, 8:45 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 1
Igor Makarsky , I'm sorry your link shows 404 error
22nd Jun 2018, 9:19 AM
Hemath Kumar
Hemath Kumar - avatar
+ 1
But, I'll implement your idea of cookies!! Thank you bro!
22nd Jun 2018, 9:20 AM
Hemath Kumar
Hemath Kumar - avatar
+ 1
Igor Makarsky hey bro, but if any user made the first registeration in one system and tried to login with another means, what should I do? I have an idea, I'm going to create a separate file which stores something that, this user visited this page and I'll check the values and redirect them!! Will it work? on the server side?
22nd Jun 2018, 9:26 AM
Hemath Kumar
Hemath Kumar - avatar
+ 1
😂 lol.....
22nd Jun 2018, 10:11 AM
Hemath Kumar
Hemath Kumar - avatar