Sign
prepare($sql); $stmt->bindValue(“:email_id”, $email); $stmt->execute(); $result = $stmt->fetchAll(); if ($result[0][“count”] > 0) { $msg = “Email already exist”; $msgType = “warning”; } else { $sql = “INSERT INTO `tbl_users` (`name`, `pass`, `email`) VALUES ” . “( :name, :pass, :email)”; $stmt = $DB->prepare($sql); $stmt->bindValue(“:name”, $name); $stmt->bindValue(“:pass”, md5($pass)); $stmt->bindValue(“:email”, $email); $stmt->execute(); $result = $stmt->rowCount(); if ($result > 0) { $lastID = $DB->lastInsertId(); $message = ‘Hi ‘ . $name . ‘!
‘; $message .= ‘CLICK TO ACTIVATE YOUR ACCOUNT‘; $message .= ““; // php mailer code starts $mail = new PHPMailer(true); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 1; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = “ssl”; // sets the prefix to the servier $mail->Host = “smtp.gmail.com”; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server $mail->Username = ‘dj4rkg@gmail.com’; $mail->Password = ‘dev@62das’; $mail->SetFrom(‘dj4rkg@gmail.com’, ‘Your Name’); $mail->AddAddress($email); $mail->Subject = trim(“Email Verifcation “); $mail->MsgHTML($message); try { $mail->send(); $msg = “An email has been sent for verfication.”; $msgType = “success”; } catch (Exception $ex) { $msg = $ex->getMessage(); $msgType = “warning”; } } else { $msg = “Failed to create User”; $msgType = “warning”; } } } catch (Exception $ex) { echo $ex->getMessage(); } } get_header(); ?> “”) { ?>