WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Security, Password lock out after three tries, authorization fails and is logged locked out of account till admin decides he will unlock it.
Categories : Sessions, PHP, MySQL, PHP Options and Info Update Picture
Matt Jezorek
Date : Sep 30th 1999
Grade : 4 of 5 (graded 4 times)
Viewed : 14913
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Matt Jezorek
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?
//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
A login page that require username, password and userlevel.
Categories : PHP, Security, Sessions, MySQL, Databases
bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager
Categories : MySQL, PHP, MySQL, Complete Programs, Databases
Simple PHP Form Auto Generation based on MySQL query
Categories : PHP, Form Processing, Databases, MySQL, Sessions
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
php-gtk mysql querying tool
Categories : PHP-GTK, MySQL, PHP, Databases
Dynamically generated pop-ups (Select items)
Categories : PHP, HTML and PHP, MySQL, Databases
SQL / PHP based Integrated Authentication
Categories : PHP, Authentication, Databases, MySQL
mediaCat-GTK v2.0.0 - an mp3/cd/dvd cataloging utility written in php-gtk which interfaces with mysql and ms access (or db supported by PHP's Unified ODBC Functions)
Categories : PHP, MySQL, MS Access, Utilities, Databases
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Complex paging with no resultset limit
Categories : PHP, MySQL, Databases, Output Control, HTML and PHP
MySQL Connection/Query Class
Categories : Databases, MySQL, PHP, PHP Classes
Multi-table database search for your WAP-enabled device. Uses PHP and MySQL. No WMLscript.
Categories : WAP, WML, PHP, MySQL
phpFormGenerator for Dynamic Form Generation from MySQL
Categories : PHP, PHP Classes, MySQL, Databases, HTML and PHP