Advertisement
Guest User

php code

a guest
Oct 12th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. <?php
  2. if (isset($_POST['usname']) && isset($_POST['pasw'])){
  3.    
  4.     $username = mysql_ramznegar($_POST['usname'],$link);
  5.     $password = mysql_ramznegar($_POST['pasw'],$link);
  6.    
  7.     $query = "SELECT * FROM `admin` WHERE `usname` = $username";
  8.     $admin_result = mysql_query($query,$link);
  9.     $admin_result = mysql_fetch_array($admin_result,MYSQL_ASSOC);
  10.    
  11.     if($admin_result['usname']==$username && $admin_result['passw']==$password){
  12.        
  13.  
  14.             if($admin_result[usname] == "admin"){
  15.  
  16.             $_SESSION['auth'] = 1;
  17.                                                
  18.                 redirect("panel");
  19.                                                
  20.                    exit;                               
  21.  
  22.     }
  23.      else{
  24.        
  25.         echo 'ur username or password is invalid';
  26.         redirect("index.php");
  27.      }
  28.    
  29.  
  30. }
  31.  
  32. }
  33.  
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement