Jump to content

username expire


I-AM-OBODO

Recommended Posts

Okay well create the field and assign the default value to 0.  If the table is called expire_login then you would just do a query like:

 

if(isset($_POST['login_button'])
{
   $results = mysql_query("SELECT expire_login FROM users WHERE username = " . $username . ";");
   $data = mysql_fetch_array($results);
   if($data['expire_login']    {
     //update database
     mysql_query("UPDATE users SET expire_login = expire_login + 1;") or die (mysql_error());
   }
   else {
     //make them change their name/password
   }
}

 

This is not tested, sorry for any mistakes.

Link to comment
Share on other sites

will this delete both the username and password?

 

No, my script is half pseudo code, it probably won't do anything if you just CnP into your page.  You have to modify it to fit your specific code, if you try to do it and post what you have then we can help you further.

Link to comment
Share on other sites

I have not started anything on it yet, i was just told i if i could do something like that and i told them i could. i am doing it from the scrash. the code you gave, would it work with a basic usrname and password login? modified of corse

 

Then you have a lot of work to do.  Sounds like you don't even have a database or anything set up.  Sorry, you might want to try to post in the freelance section because this sounds like a lot of work. 

 

I, and most people on these forums, are willing to help here and there but for something like this I don't think anyone really is going to do this for free unless they already have a login system set up to give to you.  Good luck.

Link to comment
Share on other sites

Oh! thanks for the help. I have designed the login and all seems to be working fine, but the problem now is when a user is loggen in, and for a reason or another he refreshed the page, the log count increases by 1 and its a problem. Is there a way of solving these?

Thanks

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.