Hey everyone, i have created a simple login and register form in php, when i logs-in a welcome page appears and it says Welcome user_name. I want that when the user logs-in he can view all his description like id, gender, firstname, lastname etc… How can i do this please help me i am new to this???
Well, in your registration form and PHP code to save that data into your database, you use a query to insert the data. You would need to create a new query that would read his/her data instead of saving it. Then, you would need to display the data in some form that make sense.
So, the steps needed…
First, in your “log-in” form where the user enters his/her userid and password, you would need to pass the userid to the php program.
The php program would have to create a query using that userid that was passed to it.
(something like: “SELECT * from usertable WHERE userid=$userid” … )
Then, you execute the query which will give you back the information in the row of data from the database.
Lastly, then you would display the data in the row.
I suggest you look at some of the samples in this site and you will see how to do this. If you can not figure it out, let us know and we can help. If you do ask more on this topic, make sure you show us some of your registration and login code so we can help. As always, do not post your connection’s userid and password. And, please put your code inside the PHP tags above…
Good luck…