0

I created a page, where user can register himself/herself. At the time of first login of user, user will redirect to add-profile page, where user can create his/her profile, after creation of profile user will redirect to another page which is account page where he/she can check his/her profile.

And my problem starts here, when the same user login his/her account second time, he/she will again redirect to add-profile page. But here i want to redirect user to account page, because user completed his/her profile page.

Does anyone know, how to achieve this? I mean what logic will be apply here.

9
  • 1
    when user login try to check out in back end that his profile is completed or not by adding an column in your table profile_complete. give thi value to 1 or 0 if 1 means it already competed his profile. now in login function check that user name password is correct ? if yes then profile is completed or not? if no then redirect to profile complete page otherwise on the page where you want. Apr 6, 2015 at 6:42
  • @anantkumarsingh I made a column named profile_complete and after completion of profile the value of profile_complete field is set to 1. How i create a query for this checking. This is my login query $login = mysql_query("SELECT * FROM user WHERE (email = '" . mysql_real_escape_string($_POST['email']) . "') and (password = '" . mysql_real_escape_string($_POST['password']) . "')");
    – user4514748
    Apr 6, 2015 at 7:45
  • Can i write it as an answer? Apr 6, 2015 at 7:47
  • @anantkumarsingh Yes sure, profile table name is profile_description.
    – user4514748
    Apr 6, 2015 at 7:55
  • Please check, read and follow instruction also. Apr 6, 2015 at 8:12

3 Answers 3

0

There could be multiple possible solutions and it all depends on your project requirement.

A possible solution is, you can create a flag/status column in your table which says about the basic completion of user profile.

Means you can set its value to true when user has submitted some basic details that is mandatory for your project. In that case you can redirect user to some other page else redirect to add profile page.

0

The best way to achieve this is to add a new field and if the user completed the profile page set the field value as 1. After logging in you check the field and if it set to 1 redirect it to the account page. That is it

0

The solution is simple, you just have to create an extra column named as user_profile_complete in your user database table, which takes boolean values (i.e True/False). True value means user completed it's profile while False means not completed yet it's profile.By default , you have to set it's value as Flase.

So after user registeration, you know to redirect user to fill profile details page. But, when after user login, first you have to check whether user completed it's profile or not by checking the user_profile_complete column (Note:- you can query to get user_profile_complete field value at login time or you can create separate query).If user_profile_complete is False , you have to redirect user to fill profile details page, otherwise redirect to it profile page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.