Jump to content


Photo

Login Display


  • Please log in to reply
1 reply to this topic

#1 mrgoodboy77

mrgoodboy77
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 30 July 2006 - 12:55 PM

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!

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 30 July 2006 - 01:09 PM

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.

<?php
session_start();


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

Now you can display this is html like this

<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>

Hope this helps,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users