<?php 
error_reporting(1);    
@session_start();	
include('config.php');  
      $mobile = mysqli_real_escape_string($conn,$_POST['mobile']);
    $password = mysqli_real_escape_string($conn,$_POST['password']);
	
	$pass = md5($password);

  

     
	    $sql_query = "select * from admin where username='".$mobile."' and password='".$pass."'";
        $result = mysqli_query($conn,$sql_query);
        $row = mysqli_fetch_array($result);
       $count=mysqli_num_rows($result);
        //$count = $row['cntUser'];
//echo $count; 
        if($count == 1){
           
$_SESSION['adminid']=stripslashes($row['admin_id']); 
$_SESSION['admin_mobile']=$row['mobile'];

            header('Location: welcome.php');
        }else{
           header('Location: index.php?flag=fail');
        }

    

    ?>  