Search the Community
Showing results for tags 'php sign up'.
-
Actually, what i want to do is to use the email to fetch the $email,$password and $randomnumber from database after the $key UPDATES where email is $email and sets it to null, then the fetched variables can be emailed to user's email my code below, doesnt work as expected <?php include ('database_connection.php'); if (isset($_GET['email']) && preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/', $_GET['email'])) { $email = $_GET['email']; } if (isset($_GET['key']) && (strlen($_GET['key']) == 32))//The Activation key will always be 32 since it is MD5 Hash { $key = $_GET['key']; } if (isset($email) && isset($key)) { // Update the database to set the "activation" field to null $query_activate_account = "UPDATE members SET Activation=NULL WHERE(email ='$email' AND Activation='$key')LIMIT 1"; $result_activate_account = mysqli_query($dbc, $query_activate_account) ; // Print a customized message: if (mysqli_affected_rows($dbc) == 1)//if update query was successfull { // Send the email: $message = " Your Account has now been verified, Below are your Details.\n\n"; $message .= " __________________________________________ Username: $username Password: $Password Account Number: $randomnumber __________________________________________ Please Ensure you keep safely."; echo '<div class="success">Your account is now active and your Account details sent to you. You may now <a href="login.php">Log in</a></div>'; mail ($email, "Activation Success", $message, 'From:My site<no-reply@xxxx.com>');