Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 352
1 Users 8 Guests Online

Remember Me

To get started theres really only one file you will want to deal with and that is login.php
Open it up and find:
Code

<tr>
<td>Password:</td>
<td><input type='password' name='password' size='30' maxlength='25'></td>
</tr>


After </tr> add:
Code

<tr>
<td>Remember Me? </td>
<td><input type='checkbox' name='rememberme' value='RememberMe'></td>
</tr>


Next find:
Code

$checkuser = mysql_num_rows($uinfo);
//if user name not found in database error


Add After:
Code

$remember = addslashes($_POST['rememberme']);
//check if the user added a check to the remember me box
if($remember != null){ //check if it isn't null
$_SESSION['YourSiteNameUserName'] = $username //set to username
} //end null check ;)


Finally find:
Code

<input type='text' name='username' size='30' maxlength='25'>


Replace With:
Code

<input type='text' name='username' size='30' maxlength='25' value='".$_SESSION['YourSiteNameUserName']."'>


Requested by new2old ;)
ShadowMage
Author:
Views:
2398
Rating:
Posted on Monday 6th October 2008 at 07:59 AM
jambomb
jambomb
Well... Show us how
Posted on Monday 6th October 2008 at 03:10 AM
Persis
Persis
the best way for remember me is to use cookies that don't expire for a number of days, like 100 days is really effective =P
Posted on Tuesday 8th April 2008 at 01:31 AM
UrbanTwitch
UrbanTwitch
Yea it also has some errors.
Posted on Tuesday 5th February 2008 at 12:35 PM
DanielXP
DanielXP
The session will only keep when your browser is open.

Soon as you computer has restared, it wont remember.

Would be better using a cookie
Posted on Monday 4th February 2008 at 09:56 PM
new2old
new2old
Except change

Code

$_SESSION['YourSiteNameUserName'] = $username //set to username


to
Code

$_SESSION['YourSiteNameUserName'] = $username; //set to username


:)
Posted on Monday 4th February 2008 at 09:53 PM
new2old
new2old
Works like a charm ;)
Posted on Monday 4th February 2008 at 09:45 PM
new2old
new2old
my msn is chris@i-dont-give-a-fuck.com
Posted on Monday 4th February 2008 at 09:26 PM
new2old
new2old
haha shame my msn dont work lol

wont let me add you properly lol
Posted on Monday 4th February 2008 at 09:07 PM
ShadowMage
ShadowMage
Same here
me + Smarty = not friends D:
Posted on Monday 4th February 2008 at 09:06 PM
new2old
new2old
Just when i thought i was getting good at PHP, theres alot more i need to learn