|
|
|
<?
//Here is the function check it out if you like it let me
//know if you think it needs help let me know just something
function lockout($user_id)
{
/*
This will lock out after 3 invalid logins It will flag the
Locked tag so then when login is attempted It will give the friendly
Error that tells them that there account is locked and someone will get
there account back up and running shortly
*/
$db = mysql_connect("localhost","user","pass");
mysql_select_db("database",$db);
$query = "SELECT * FROM log_attempts where login = '$user_id'";
$result = mysql_query($query);
$num = mysql_num_rows($result);
if ($num=="0")
{
$sql="INSERT INTO log_attempts values('$user_id','','')";
mysql_query($sql,$db);
}else{
while($row = mysql_fetch_array($result))
{
$times = $row["times"];
$i = $times ; $i++;
$sql = "UPDATE log_attempts SET times='$i' WHERE login='$user_id'";
$done = mysql_query($sql);
}
}
$attempt = $i;
if ($attempt == "3")
{
$lock = "yes";
$sql = "UPDATE log_attempts SET locked='$lock' WHERE login='$user_id'";
$result = mysql_query($sql,$db);
print "You have entered an invalid password three times. We have locked your account for security reasons.";
print "\n An email was sent to the site administrator he will evaluate the activity of your account and will\n";
print "then choose if he will re-activate your account. They may have some questions to ask you so please be on";
print "the look out for an email from <a href=mailto:admin@before-ipo.com>admin@before-ipo.com</a>";
print "<BR><BR><BR>We are sorry for the inconvience";
}else{
$sql = "UPDATE log_attempts SET times='$i' WHERE login='$user_id'";
$result = mysql_query($sql,$db);
}
return true;
}
?> |
|
| database,php,mysql,demo,example,php3,training,tutorial,codes,code Categories : Databases, MySQL, PHP, PHP Options and Info | | | Sessions and -enable-trans-sid Categories : PHP, PHP Configuration, PHP Options and Info, Sessions | | | bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager Categories : MySQL, PHP, MySQL, Complete Programs, Databases | | | Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0 Categories : PHP, Sessions, Databases, MySQL | | | A login page that require username, password and userlevel. Categories : PHP, Security, Sessions, MySQL, Databases | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | Cut your MySQL Connections to 1 line of code Categories : PHP, Beginner Guides, Databases, MySQL | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | Basic Authentication with sessions Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions | | | Displaying records of database in more than one page (paging) Categories : Databases, MySQL, PHP | | | Retrieve text from table and email to your e-
address in pipe delimited format. Categories : PHP, MySQL | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | PCAC (pretty cool auction client), auction client server applications Categories : PHP, MySQL, Ecommerce | | | PHP4 session helper HTML file.
Categories : PHP, Java Script, HTML and PHP, Sessions | |
|
|
|