Guest User

Untitled

a guest
Aug 5th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. php activate account error
  2. $message="Enter your email and password to activate your account.";
  3.  
  4. if ($_POST['activate']){
  5.  
  6. $email = $_POST['email'];
  7. $password = $_POST['password'];
  8. $user = $_GET['user'];
  9. $code = $_GET['code'];
  10.  
  11. $query=mysql_query("SELECT * FROM users WHERE email='$email'");
  12.  
  13. if (!$query){
  14. echo "Couldn't connect to database.";
  15. exit();
  16. }
  17.  
  18. while ($getrows = mysql_fetch_assoc($query)){
  19. $dbuser = $getrows['username'];
  20. $dbpassword = $getrows['password'];
  21. $dbcode = $getrows['code'];
  22.  
  23. if ( ($user == $dbuser) && ($password == $dbpassword) && ($code == $dbcode) ){
  24. $update=mysql_query("UPDATE users SET active='1' WHERE email='$email'");
  25.  
  26. if ($update)
  27. $message="Your account has been activated.";
  28. }
  29. else{
  30. $message="Your information does not match. Your account has not been activated.";
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment