Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. if(isset($_POST['submit'])){
  6.  
  7. $username = htmlspecialchars(trim($_POST['username']));
  8. $password = htmlspecialchars(trim($_POST['password']));
  9. $repeatpassword = htmlspecialchars(trim($_POST['repeatpassword']));
  10.  
  11.  
  12.  
  13. if($username&&$password){
  14. $password = md5($password);
  15. $connect = mysql_connect('pv','pv','pv');
  16. mysql_select_db('pv dsl poto');
  17.  
  18. $log = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
  19. $rows = mysql_num_rows($log);
  20.  
  21.  
  22. if($rows==1){
  23. $_SESSION['username']=$username;
  24. header('Location: /index.php');
  25. exit();
  26.  
  27.  
  28.  
  29.  
  30. }else{
  31. header('Location:login123.php');
  32. }
  33.  
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. }
  42.  
  43.  
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement