| View previous topic :: View next topic |
| Author |
Message |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Mon Dec 15, 2008 5:38 pm Post subject: [Help] PHP - populate page with field data |
|
|
Im quite noob with php and mysql so im unsure how to do this.
I have a feeling im prob missing some If's and is prob quite easy to do, but i wonder if anyone can help me as im unsure of the syntax.
Basic info.
I have a mysql database with the table name "members" which lists member usernames and passwords (md5 encrypted)
the fields are as follows
id - user - password - details
i have a login page which checks for user and password and then redirects you to a sucessful login page.
However, i wish to know how i can display "details" field on thew new page, but only the details relating to the original login user.
How would i edit my sucessful login page?
| Code: | <?
session_start();
if(!session_is_registered(myusername)){
//code to add here
header("location:main_login.php");
}
?>
<html>
<body>
Details
</body>
</html> |
Im sure it can be done just by getting the field data for "details" but im not sure what the syntax is.
And also, would it only show the details field that is connected to the username field only?
|
|
| Back to top |
|
 |
sloppy Expert Cheater
Reputation: 0
Joined: 17 Aug 2008 Posts: 123
|
Posted: Mon Dec 15, 2008 7:58 pm Post subject: |
|
|
| Save the details field to a session variable in your main_login.php, then use echo $_SESSION['details']; to output the data. session_regsiter(), session_is_registered() and session_unregister() have been deprecated. Replace them with $_SESSION['variable'] = 'value', isset() and unset().
|
|
| Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Tue Dec 16, 2008 4:30 am Post subject: |
|
|
ok thank you for that, i will try it i wanted to stay away from loads of seperate pages for each user, and this should fix that.
|
|
| Back to top |
|
 |
|