Bavilo Posted May 24, 2006 Share Posted May 24, 2006 Hello everyone,I'm helping a friend with some scripting. I made a register and login script that takes the raw input and puts it into a database, the password is encrypted in md5, that part works, aswell as the login part but i need to display a unique page for each user. Basically my friend will create the usernames and passwords with the register script, lets say the username is 123 and the password is 321, when i enter 123 in the login box and i successfully login the page should now display information about only the user "123" such as a schedule, of things this user has to do and so on. I was thinking about using something like this.[code]<? if (isset($_SESSION['s_username'])) { echo "<b>Welcome</b> ".$_SESSION['s_username']."!"; } ?>[/code]This will display the name of the username that was entered in the login script, but instead i want it to check what username was entered, (in this case "123") take that username, check if its in the database and use that in the session code above instead of "username". Also, if 123 is logged in, it will not echo[code]<b>Welcome</b> ".$_SESSION['s_username']."!";[/code] , but other php snippets, codes, html, whatever. Ok just to wrap it up, what i am trying to figure out is how to change the content on a page such as a schedule that will be different for every user that signs on. Hopefully someone can point me to some examples or explain how this could be done. If anything is unclear please let me know, i will try to explain it some more.ThanksMike Quote Link to comment https://forums.phpfreaks.com/topic/10319-mysql-and-sessions/ Share on other sites More sharing options...
trq Posted May 24, 2006 Share Posted May 24, 2006 Stoe a users info in the datebase, then simply run a query like...[code]$sql = "SELECT * FROM users WHERE user_id = {$_SESSION['id']};";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10319-mysql-and-sessions/#findComment-38469 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.