mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-22 19:58:03 +00:00
27 lines
827 B
Plaintext
27 lines
827 B
Plaintext
<?php
|
|
|
|
require('connect.php');
|
|
|
|
if (isset($_POST['username']) and isset($_POST['password'])){
|
|
$username = $_POST['username'];
|
|
$password = $_POST['password'];
|
|
|
|
$query = "SELECT * FROM `<%= @user_table_name %>` WHERE Username='$username' and Password='$password'";
|
|
$result = mysqli_query($conn2, $query);
|
|
$count = mysqli_num_rows($result);
|
|
|
|
if ($count == 0){
|
|
if (mysqli_error($conn2)) {
|
|
header("location:login.php?LoginError=".mysqli_error($conn2));
|
|
} else {
|
|
header("location:login.php?LoginError=".urlencode("Your credentials are incorrect. Please try again."));
|
|
}
|
|
} else {
|
|
$_SESSION['username'] = $username;
|
|
header("location:profile.php");
|
|
}
|
|
} else {
|
|
header("location:login.php?LoginError=".urlencode("Please provide a Username and Password!"));
|
|
}
|
|
?>
|