Jump to content

Login Display


mrgoodboy77

Recommended Posts

I'm looking for a way to once someone logs in using there username and pw, it will display info that I have stored about that person. Something like you see on Amazon or other big sites, ya know.
A) How do I display the stuff on a html page
B) Where do I store the stuff
I'm still new at php, so if theres a script out there for me or something..
Thanks!
Link to comment
Share on other sites

ok what you are referring to is sessions or cookies.

for sessions do this in your login script.

at the begining of your script put this. This must come first, before anything else.

[code=php:0]
<?php
session_start();
[/code]


Now after you process the login. You can set the session variables like this
[code=php:0]$_SESSION['username'] = $username[/code] You can repeat this for anything that you want to store in the session

Now you can display this is html like this

[code=php:0]
<html>
<head><title>Test Page</title></head>

<body>
<p>Welcome <b><?php echo $_SESSION['username']; ?></b>. You are now logged in.</p>
<!---some more html--->
</body>
</html>
[/code]

Hope this helps,
Tom
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.