Jump to content

daikumi

New Members
  • Posts

    2
  • Joined

  • Last visited

daikumi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for the reply sir jcbones. The codes I posted is already running. I just don't know how to add a login attempt in that code, but thnaks for correcting my code. Sir premiso, sorry if I posted it like that Im still a beginner and I don't have much knowledge on php and Im running out of time :'(
  2. <html> <head> <title>LOG IN</title> </head> <?php session_start(); $username = (@$_POST['username']); $password = (@$_POST['password']); $error['alert'] = ''; $error['username'] = ''; $error['password'] = ''; $input['username'] = ''; $input['password'] = ''; if (isset($_POST['submit'])) { if ($_POST['username'] == '' || $_POST['password'] == '') { if ($_POST['username'] == '') { $error['username'] = 'required'; } if ($_POST['password'] == '') { $error['password'] = 'required'; } $error['alert'] = 'Please fill in required fields!'; $_POST['username']; $_POST['password']; include('v_login.php'); } else $error['alert'] = "Username or Password is incorrect"; { if ($username&&$password) { $connect = mysql_connect("server","dbusername","dbpassword"); mysql_select_db("dbname") or die ("Couldn't find db"); $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows= mysql_num_rows($query); if($numrows!==0) { while($row=mysql_fetch_assoc($query)) { $dbusername= $row['username']; $dbpassword= $row['password']; $activated= $row['activated']; if($activated=='0') { header("location:not_active.php"); exit(); } } if($username==$dbusername&& md5($password)==$dbpassword) { header("location:member.php"); $_SESSION['username']=$username; } else $error['alert'] = "Username or Password is incorrect"; include('v_login.php'); } else { $error['alert'] = "Username or Password is incorrect"; include('v_login.php'); } } else { echo ""; } } } else { include('v_login.php'); } ?> </html> I would like some codes for the login attemp that will block the user for 3mins if the user fail to input correct password in 3 times
×
×
  • 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.