I developed a member registration system, but I wanted them to login and go to their member id which is a primary key and is is generated uniquely for each member, but I am not sure how. The row in the mysql database is named id. When I do it, the address is something like this: logincheck.php?id= . So it is not getting the id. How can I do this? When I enter in the unique id, and then login it goes to that members profile, so how can I do this? Also, I also have it so that it will check the id so that the person is not trying to go into someone else’s profile. Also, if someone could suggest If I should just use sessions please so. I am not sure what to use, I am guessing that sessions would be easier, but I am not that good with them. Tutorials and anything will help, THANKS
You can use the header function to change the location of the page when the user logs in.
e.g.
$userid = ""; // Just put the user id variable here
header("location http://www.mydomain.com/logincheck.php?id=".$userid);
That header function will divert the page to the chosen address, but you MUST make sure it is called before any infomation is sent to the page itself.
Storing session variables easy.
// enable sessions for the page
session_start();
// Register the session variable
session_register("userid");
// Assign a value to the variable
$_SESSION['userid'] = $value;
// Read from the session variable
// (Available to all pages if session_start() is called)
$myVariable = $_SESSION['userid'];