Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- php activate account error
- $message="Enter your email and password to activate your account.";
- if ($_POST['activate']){
- $email = $_POST['email'];
- $password = $_POST['password'];
- $user = $_GET['user'];
- $code = $_GET['code'];
- $query=mysql_query("SELECT * FROM users WHERE email='$email'");
- if (!$query){
- echo "Couldn't connect to database.";
- exit();
- }
- while ($getrows = mysql_fetch_assoc($query)){
- $dbuser = $getrows['username'];
- $dbpassword = $getrows['password'];
- $dbcode = $getrows['code'];
- if ( ($user == $dbuser) && ($password == $dbpassword) && ($code == $dbcode) ){
- $update=mysql_query("UPDATE users SET active='1' WHERE email='$email'");
- if ($update)
- $message="Your account has been activated.";
- }
- else{
- $message="Your information does not match. Your account has not been activated.";
- }
- }
- }
Add Comment
Please, Sign In to add comment