Page 1 of 1

Newbie question

Posted: Mon Nov 09, 2009 2:01 pm
by timwhelan
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

Re: Newbie question

Posted: Mon Nov 09, 2009 4:53 pm
by Eric!
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?

Re: Newbie question

Posted: Mon Nov 16, 2009 9:13 am
by timwhelan
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...

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']);
 
I hope that if anyone gets stuck that this helps.

peace
tim