Greetings,
I have run into an issue. This dom prevents me from submitting that is POST request is not made.Can you guys help me out? I have posted the links to my code herewith. I’d be really greatful for your help.
<?php
session_start();
require_once "pdo.php";
$check = FALSE;
if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['password1']) && isset($_POST['password2']) ){
echo "hello";
$check =TRUE;
$name = htmlentities($_POST['name']);
$vkey = md5(time().$name);
$email = htmlentities($_POST['email']);
if($_POST['password1'] === $_POST['password1']){
$password = md5($_POST['password1']);
$sql = "INSERT INTO admin (Username,email,password,vkey) VALUES (:name,:email,:password,:vkey)";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(
':name' => $_POST['name'],
':email' => $_POST['email'],
':password' => $password,
':vkey' => $vkey
));
/*$_SESSION['success'] = "Record added";
header("Location: index.htm");
return;*/
if($stmt){
$to_email = "myemail@gmail.com";
$subject = "Activate the admin ";
$body = "<a href = 'http://localhost/tasteit/admin/verify.php?vkey=$vkey'> CLick to verify </a>";
$headers = "From: myemail@gmail.com \r\n";
$headers = "MIME-Version: 1.0"."\r\n";
$headers .= "Content-type:text/html;charset-UTF-8"."\r\n";
if (mail($to_email, $subject, $body, $headers)) {
echo "Email successfully sent to $to_email...";
header('location:thankyou.php');
} else {
echo "Email sending failed...";
}
}
}else{
$_SESSION['error'] = "passwords do not match";
}
}
?>