PHP Code to perform Simple Log-In System Version 1.0

PHP Code to perform Simple Log-In System Version 1.0

Welcome to this code of…… If you have any difficulty regarding this code, please like our page for discussions. Click here to like the page. https://www.facebook.com/Free-Code-Download-934630353410011/

PHP Code to perform Simple Log-In System Version 1.0
PHP Code to perform Simple Log-In System Version 1.0

http://freecodedownload.com/wp-content/uploads/2019/01/login.zip

File Name:

login2.php

<?
session_start();
include_once(“connect2.php”);
$username=$_POST[‘username’];
$password=$_POST[‘password’];

$sql = “SELECT * FROM users WHERE username=’$username’ AND password=’$password'”;
$result = mysql_query($sql);
?>
<html>
<head>
<title>Login Verify Page</title>
</head>
<body bgcolor=”#CCCCFF” text=”#330099″>
<?
//check that at least one row was returned
$rowCheck = mysql_num_rows($result);
if($rowCheck < 1){
?>
<h1 align=”center”>Login Failed</h1>
<br /><br />
<p align=”center”>
Incorrect login name or password. <br>
Please <a href=”./”>try again.</a>!
</p>
<?
exit;
}
else {
while($row = mysql_fetch_array($result)){
//start the session and register a variable

session_register(‘username’);
//echo “Logged in successfully!”;
//session_start();
//session_register(‘username’);

//successful login code will go here…
// header( “Location: checkLogin.php” );
//header(“Location: main.php”);
?>

<h1 align=”center”>Login Successful</h1>
<br /><br />
<p align=”center”>
To proceed to the Main Page. <br>
Please <a href=”main.php”>click here.</a>!
</p>
<?
}
//if nothing is returned by the query, unsuccessful login code goes here…
}
?>
</body>
</html>

 

Leave a Reply

Your email address will not be published. Required fields are marked *