i need a help with this. What i need to do to validate the email in this form? This is a landing page, I want to get the email of a visitor before he/she can visit my content here is this demo.
Can I get some tips or the right code to use for this page?
<form id="contact-form" action="send.php">
<input type="text" name="email" placeholder="you@yourmail.com" class="cform-text" size="40" title="your email" required>
<input type="submit" value="Enter Now" class="cform-submit">
</form>
send.php file:
$visitorEmail = $_GET['email'];
$email_from = "doctordongok@gmail.com";
$email_subject = "New Form Submission! - From: " + $visitorEmail;
// edit here
$email_body = "New visitor - $visitorEmail";
$to = "doctordongok@gmail.com";
$headers = "From: $email_from \r \n";
$headers .= "Reply-To: $visitorEmail \r \n";
mail($to, $email_subject, $email_body, $headers);
header("Location: http://www.de-signs.com.au");
Thank you!