Guest User

Untitled

a guest
May 29th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. $java = new java();
  3.  
  4.  
  5. class java {
  6. function popup($text)
  7. {
  8. echo '<script type="text/javascript"> alert(\''.$text.'\');</script>';
  9. }
  10. function redirect($url)
  11. {
  12. echo '<script> window.location = "'.$url.'"</script>';
  13. }
  14. }
  15.  
  16. class profile {
  17. function login($username,$password)
  18. {
  19. $new_password = md5($password);
  20. $result=mysql_query("SELECT * FROM accounts WHERE Username='$username' AND Password='$new_password' LIMIT 1");
  21. if (mysql_numrows($result) == 0)
  22. {
  23. echo '<script type="text/javascript"> alert(\'Incorrect login information\');</script>';
  24. }
  25. while($user_r=mysql_fetch_array($result))
  26. {
  27. $user_username = $user_r["Username"];
  28. $user_password = $user_r["Password"];
  29. $user_class = $user_r["Title"];
  30.  
  31. $_SESSION['status'] = 'Logged';
  32. $_SESSION['username'] = $user_username;
  33. $_SESSION['password'] = $user_password;
  34. $_SESSION['class'] = $user_class;
  35. $java->redirect("index.php"); ## Line that is non-object
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment