Newbie question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
timwhelan
Forum Newbie
Posts: 8
Joined: Mon Sep 18, 2006 11:34 am

Newbie question

Post 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
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Newbie question

Post 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?
timwhelan
Forum Newbie
Posts: 8
Joined: Mon Sep 18, 2006 11:34 am

Re: Newbie question

Post 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
Post Reply