Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

php code

By: a guest on Oct 12th, 2012  |  syntax: PHP  |  size: 0.83 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>