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
https://forums.phpfreaks.com/topic/16019-login-display/
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
https://forums.phpfreaks.com/topic/16019-login-display/#findComment-65877
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.