Advertisement
Guest User

code

a guest
Oct 12th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.86 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. include ('includes/config.php');
  6. include ('includes/functions.php');
  7.  
  8. if  (@ $_SESSION['auth']==1 ) {
  9.    
  10.         redirect("panel",100);
  11.  
  12. }
  13.  
  14.  
  15.  
  16. ?>
  17.  
  18.  
  19.  
  20. <!DOCTYPE HTML>
  21. <html>
  22. <head>
  23.     <meta http-equiv="content-type" content="text/html" />
  24.     <meta name="Javad Pourmostafa"  />
  25.  
  26.     <title>رمزنگار Version 1.0</title>
  27. <link href="style.css" rel="stylesheet" type="text/css">
  28. </head>
  29.  
  30. <body>
  31. <?php if (!isset($_POST['usname']) && !isset($_POST['pasw'])) { ?>        
  32.  
  33.  
  34.  
  35. <div class="head">
  36. برای ورود به پنل مدیریت نام کاربری و رمز عبور را وارد کنید
  37. </div>
  38.  
  39. <form action="" method="post" class="form">
  40.  
  41.   <p>
  42.   <input name="usname" type="text" class="usp" size="0">
  43.   </p>
  44.   <p>
  45.     <input name="pasw" type="password" class="usp" size="0">
  46.   </p>
  47.   <p>
  48.     <input name="submit" type="submit" class="submit" value="ورود">
  49.   </p>
  50.  
  51.  
  52. </form>
  53. <?php } //close if tag ?>
  54.  
  55.  
  56. <?php
  57. if (isset($_POST['usname']) && isset($_POST['pasw'])){
  58.    
  59.     $username = mysql_ramznegar($_POST['usname'],$link);
  60.     $password = mysql_ramznegar($_POST['pasw'],$link);
  61.    
  62.     $query = "SELECT * FROM `admin` WHERE `usname` = $username";
  63.     $admin_result = mysql_query($query,$link);
  64.     $admin_result = mysql_fetch_array($admin_result,MYSQL_ASSOC);
  65.    
  66.     if($admin_result['usname']==$username && $admin_result['passw']==$password){
  67.        
  68.  
  69.             if($admin_result[usname] == "admin"){
  70.  
  71.             $_SESSION['auth'] = 1;
  72.                                                
  73.                 redirect("panel");
  74.                                                
  75.                    exit;                               
  76.  
  77.     }
  78.      else{
  79.        
  80.         echo 'نام کاربری یا پسورد شما اشتیاه م باشد';
  81.         redirect("index.php");
  82.      }
  83.    
  84.  
  85. }
  86.  
  87. }
  88.  
  89. ?>
  90.  
  91. </body>
  92.  
  93. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement