Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. $host="localhost";
  6. $username="root";
  7. $password="power1";
  8. $db_name="members";
  9. $tbl_name="users";
  10.  
  11. $link = mysql_connect($host, $username, $password)or die("cannot connect. Please contact us");
  12. mysql_select_db($db_name)or die("cannot select DB. Please contact us");
  13.  
  14. $queryString = $_SERVER['QUERY_STRING'];
  15.  
  16. $uemail = $_SESSION['$queryString'];
  17.  
  18. $query = "SELECT * FROM users WHERE email=$uemail;
  19.  
  20. $result = mysql_query($query) or die(mysql_error());
  21.  
  22. while($row = mysql_fetch_array($result)){
  23.  
  24. if ($queryString == $row[activationkey]){
  25.  
  26. echo 'Congratulations! You have succesfully activated you account. You may now login.';
  27.  
  28. $sql=("UPDATE users SET activationkey='' AND status='activated' WHERE username=".$row['username']);
  29.  
  30. if (!mysql_query($sql))
  31.  
  32. {
  33.  
  34. die('Error: ' . mysql_error());
  35.  
  36. }
  37.  
  38. }
  39.  
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement