Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require 'connect.php'; ?>
- <?php
- session_start();
- if(isset($_POST['login'])) {
- if (empty($_POST['username']) || empty($_POST['password'])) {
- ?>
- <script language="javascript">
- alert("Please Enter Credentials for Username or Password");
- window.location="indexmember.php";
- </script>
- <?php
- }
- else
- {
- $username=$_POST['username'];
- $password=$_POST['password'];
- $query = mysqli_query($con,"select * from users where user='$username'");
- $rows = mysqli_num_rows($query);
- if ($rows == 1) {
- $res = mysqli_fetch_array($query);
- $_SESSION['login_user']=$res['id']; // Initializing Session
- header("location: adminside.php"); // Redirecting To Other Page
- }
- elseif($username=="admin" && $password=="admin123")
- {
- $_SESSION['admin'] = $username;
- header("location: indexmember.php"); //take the admin to the home page
- }
- **elseif(password_verify ($pass, $row['pass'] )){**
- ?>
- <script language="javascript">
- alert("Username or Password is invalid");
- window.location="indexmember.php";
- </script>
- <?php
- **}else{
- session_start();
- $_SESSION["LoginFail"] = "Yes";
- }**
- mysql_close($con); // Closing Connection
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement