Jump to content

Mysql and Sessions


Bavilo

Recommended Posts

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.

Thanks
Mike
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.