I have a sign up page that submits information to the database.
It works.
I want to have a form that a user signs in with and when they do the next page prints out there information that they submitted. I have a form that takes the information but I don't know how to display it properly
I can print the database in rows but how do I get the single users info from the form submission.
Any help would be great! A link to a tutorial or explanation is great as well.
Thanks
Tim
Newbie question
Moderator: General Moderators
Re: Newbie question
There are lots of ways. You could read their data back out of the database and display it. You could setup a session and pass all the info you stored in your database to the new page. The list goes on.
How are you currently tracking logged in users? Sessions?
How are you currently tracking logged in users? Sessions?
Re: Newbie question
Okay, I hate leaving an answer open like this...
Here is my newbie finalization for this question. First I was able to set up sessions and track the user. I didn't remember how to print out the information from the array based on the user.
Here is that code...
I hope that if anyone gets stuck that this helps.
peace
tim
Here is my newbie finalization for this question. First I was able to set up sessions and track the user. I didn't remember how to print out the information from the array based on the user.
Here is that code...
Code: Select all
$query="SELECT * FROM table WHERE userid='$myusername' AND password='$mypassword'";
$rs=mysql_query($query);
if(!$rs) {
print("Query Error: ".mysql_error());
}
$numrows=mysql_num_rows($rs);
print("Welcome to the Course Sign up Form. Please Select the courses you are interested in attending. <br /><br />");
$customer=mysql_fetch_assoc($rs);
echo ($customer['firstname']);
echo ($customer['lastname']);
peace
tim