th92 Posted March 9, 2007 Share Posted March 9, 2007 Hello, im kinda a n00b at this, basicly i have a table, and i want it so that when the user logs in, it will display their username. So basicly how do i take info from the table, depending on the user. Could you help me plz. -Thanks -Terry Quote Link to comment https://forums.phpfreaks.com/topic/42003-display-username/ Share on other sites More sharing options...
artacus Posted March 9, 2007 Share Posted March 9, 2007 Wow. You need to read thru a few tutorials first. Quote Link to comment https://forums.phpfreaks.com/topic/42003-display-username/#findComment-203754 Share on other sites More sharing options...
LanceT Posted March 10, 2007 Share Posted March 10, 2007 Hello, im kinda a n00b at this, basicly i have a table, and i want it so that when the user logs in, it will display their username. So basicly how do i take info from the table, depending on the user. Could you help me please. -Thanks -Terry Well you must make sure the user's info is inserted into that table first. When they login you could probably just set a cookie and then retrieve the information from the mysql database using a SELECT from statement. What I would do is create a cookie for username and password. Then check if those two are set (look up "isset" on php.net). Then if the password and username match the ones in the table, retrieve the username and use an echo or print to display it. you'll need to use the following code isset - to check if the cookie has been set - http://us2.php.net/manual/en/function.isset.php SELECT * FROM yourtablename WHERE username = 'setusername' AND password = 'setpassword' (this is a mysql query, look it up on google or mysql.com) Quote Link to comment https://forums.phpfreaks.com/topic/42003-display-username/#findComment-204092 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.