Advertisement
ak47suk1

stynxphplogin

Nov 21st, 2010
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. //login
  4.  
  5. include "config.php";
  6.  
  7. if(!empty($_POST['u_email']))
  8. {
  9.  
  10. //      echo "<pre>";
  11. //      var_dump($_POST);
  12. //      echo "</pre>";
  13.        
  14.        
  15.         $email= mysql_real_escape_string($_POST['username']);
  16.         $password= ($_POST['pwd']);
  17.        
  18.         $sql = "SELECT * FROM users where username = '$email' and `pwd`='$password'";
  19.         $qid = mysql_query($sql);
  20.         if($data = mysql_fetch_array($qid))
  21.        
  22.         {
  23.            
  24.             $_SESSION['login'] = true;
  25.             $_SESSION['username'] = $data['username'];
  26.  
  27.            
  28.            
  29.        
  30.                 header ("location: profail.php");
  31.            
  32.  
  33.            
  34.         }
  35.         else
  36.         {
  37.             echo "login gagal";
  38.         }
  39. }
  40.  
  41. include "template/header.html";
  42.  
  43. include "template/login.html";
  44.  
  45. include "template/footer.html";
  46.  
  47.  
  48.  
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement