<?php
if(isset($_POST['submit'])){
$fn = $_POST['firstname'];
$ln = $_POST['lastname'];
$e = $_POST['email'];
$pn = $_POST['phonenumber'];
$ui = $_POST['username'];
$p = $_POST['password'];
if($fn && $ln && $e && $pn && $ui && $p) {
$sql = "INSERT INTO employee_details (first_name, last_name, email, phonenumber, username, password) VALUES
('$fn', '$ln', '$e', '$pn', '$ui', '$p')";
$stmt = mysqli_prepare($dbc, $sql);
mysqli_stmt_execute($stmt);
$affected_rows = mysqli_stmt_affected_rows($stmt);
if($affected_rows == 1){
$body = "Thank you for registering. To activate your account, please click on this link:<br />";
$body = "http://localhost/mbactivate.php?x=" .
mail($_POST['email'], 'Registration Confirmation', $body, 'From: derekbanas@verizon.net');
echo '<br /><br /><h3>Thank you for registering!
A confirmation email has been sent to your address. Please click on the link in that email in order to activate your account.</h3>';
mysql_close();
exit();
}
}
}
preferences:
51.41 ms | 402 KiB | 5 Q