change tabs to spaces....

This commit is contained in:
Andreas Zweili 2017-02-05 14:41:00 +01:00
parent 2bdc242dc2
commit b2ed4f90e1
1 changed files with 11 additions and 11 deletions

View File

@ -13,25 +13,25 @@ session_start();
// If form submitted, insert values into the database. // If form submitted, insert values into the database.
if (isset($_POST['username'])){ if (isset($_POST['username'])){
// removes backslashes // removes backslashes
$username = stripslashes($_REQUEST['username']); $username = stripslashes($_REQUEST['username']);
//escapes special characters in a string //escapes special characters in a string
$username = mysqli_real_escape_string($con,$username); $username = mysqli_real_escape_string($con,$username);
$password = stripslashes($_REQUEST['password']); $password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con,$password); $password = mysqli_real_escape_string($con,$password);
//Checking is user existing in the database or not //Checking is user existing in the database or not
$query = "SELECT * FROM `users` WHERE username='$username' $query = "SELECT * FROM `users` WHERE username='$username'
and password='".md5($password)."'"; and password='".md5($password)."'";
$result = mysqli_query($con,$query) or die(mysql_error()); $result = mysqli_query($con,$query) or die(mysql_error());
$rows = mysqli_num_rows($result); $rows = mysqli_num_rows($result);
if($rows==1){ if($rows==1){
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
// Redirect user to index.php // Redirect user to index.php
header("Location: home.php"); header("Location: home.php");
}else{ }else{
echo "<div class='form'> echo "<div class='form'>
<h3>Username/password is incorrect.</h3> <h3>Username/password is incorrect.</h3>
<br/>Click here to <a href='db/login.php'>Login</a></div>"; <br/>Click here to <a href='db/login.php'>Login</a></div>";
} }
}else{ }else{
?> ?>
<div class="form"> <div class="form">