From da57beb574fb9f756a7de036e8003f75ec47432c Mon Sep 17 00:00:00 2001 From: arf20 Date: Sat, 16 Mar 2024 02:51:06 +0100 Subject: Email verification --- register.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'register.php') diff --git a/register.php b/register.php index 37565c5..3ef957a 100755 --- a/register.php +++ b/register.php @@ -1,13 +1,28 @@ addAddress($rcpt); + $mailer->Subject = 'ARFNET Email Verification'; + $mailer->Body = "Welcome to ARFNET\n\nUse the following link to verify your email address\n\n" + ."https://".DOMAIN."/verify.php?code=".$code + ."\n\n--\nARFNET Client, Service, Ticket and Invoice Management System\nhttps://arf20.com"; + if (!$mailer->send()) { + echo 'Mailer Error [ask arf20]: ' . $mailer->ErrorInfo; + } +} + // Include config file require_once "config.php"; // Define variables and initialize with empty values $username = $password = $confirm_password = $email = ""; $username_err = $password_err = $confirm_password_err = $email_err = ""; +$verification_mail_sent = false; // Processing form data when form is submitted -if ($_SERVER["REQUEST_METHOD"] == "POST"){ +if ($_SERVER["REQUEST_METHOD"] == "POST") { // Validate username if (empty($_POST["username"])) $username_err = "Enter a username."; @@ -84,7 +99,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ // Attempt to execute the prepared statement if (mysqli_stmt_execute($stmt)) { // Send verification email - + send_verification_email($email, $param_verifycode); + $verification_mail_sent = true; // Redirect to login page header("location: login.php"); } else { @@ -142,6 +158,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){

Login.

+ -- cgit v1.2.3