Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("includes\config.php");
- session_start();
- if($_SERVER["REQUEST_METHOD"] == "POST")
- {
- $username=mysqli_real_escape_string($dbconfig,$_POST['username']);
- $password=mysqli_real_escape_string($dbconfig,$_POST['password']);
- $sql_query="SELECT id FROM admins WHERE username='$username' and password='$password'";
- $result=mysqli_query($dbconfig,$sql_query);
- $row=mysqli_fetch_array($result,MYSQLI_ASSOC);
- $count=mysqli_num_rows($result);
- if($count==1){
- $_SESSION['login_user']=$username;
- header("location: login_success.php");
- }
- else
- {
- $error="Username or Password is invalid";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement