Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <?php require_once("includes/connection.php"); ?>
- <?php require_once("includes/functions.php"); ?>
- <?php
- if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $uname = $_POST['username']; //retrieve input from previous pagelogin.php store in $uname
- $pword2 = $_POST['password']; //retrieve input from previous pagelogin.php store in $pword
- $pword = hash('ripemd160', $pword2);
- }
- $SQL = "SELECT * FROM login WHERE username='".$uname."'"." AND password='".$pword."'"; //construct sql query see (b)
- $result = mysqli_query($connection, $SQL );
- $num_rows = mysqli_num_rows($result);
- if ($num_rows > 0) {
- $_SESSION['login'] = $uname;
- if($uname == "Admin"){
- $location = "admin.php";
- header("Location: {$location}");
- }
- else{
- $location = "index.php";
- header("Location: {$location}");
- }
- }
- mysqli_close($connection);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement