Actualmente si un usuario de mi sitio envía un número en el campo de nombre el formulario se lo permite.
----
Contacto HTML
<!-- contact -->
<section id="contact">
<div class="container">
<div class="row bottom-pad-40 text-center custom-icon-2">
<div class="col-md-4 wow fadeInDown" data-wow-duration="1s" data-wow-delay="1.1s">
<h2 class="small-title"><span class="icon-map-pin"></span>Address</h2>
<p>---</p>
</div>
<div class="col-md-4 wow fadeInDown" data-wow-duration="1s" data-wow-delay="1.2s">
<h2 class="small-title"><span class="icon-envelope"></span>Email</h2>
<p>---</p>
</div>
<div class="col-md-4 wow fadeInDown" data-wow-duration="1s" data-wow-delay="1.3s">
<h2 class="small-title"><span class="icon-mobile"></span>Phone</h2>
<p>---</p>
</div>
</div>
</div>
<div id="map-overlay">
<!-- google map -->
<div id="map"></div>
<!-- end: google map -->
<div class="container">
<div class="row">
<div class="col-md-push-6 col-md-6">
<form id="contact-form" class="form-horizontal" method="post" action="assets/email.php">
<div class="form-group">
<div class="col-md-12 small-caret">
<div class="messages"></div>
<h2 class="small-title"><span class="fa fa-caret-right"></span>GET in touch</h2>
</div>
<div class="col-md-12">
<input class="form-control" type="text" name="name" placeholder="Name" required="required">
</div>
<div class="col-md-12">
<input class="form-control" type="text" name="subject" placeholder="Subject" required="required">
</div>
<div class="col-md-12">
<input class="form-control" type="email" name="email" placeholder="Email" required="required">
</div>
<div class="col-md-12">
<textarea class="form-control" name="message" rows="8" placeholder="Please include your cell phone number in this message, for a faster response." required></textarea>
</div>
<div class="col-md-12">
<button type="submit" class="btn contact-btn wow fadeInUp" data-wow-duration="1s" data-wow-delay=".5s">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- end: contact -->
-------
Contacto PHP
<?php
// configure
$from = 'Way2Mind Web Contact <[email protected]>';
$sendTo = 'Basic Enquiry Form <[email protected]>';
$subject = 'New message from Way2Mind Web Contact';
$fields = array('name' => 'Name', 'subject' => 'Subject', 'email' => 'Email', 'message' => 'Message'); // array variable name => Text to appear in email
$okMessage = 'Message sent successfully.';
$errorMessage = 'Message sending failed! Please try later.';
// let's do the sending
try
{
$emailText = "Enquiry Details\n---------------\n";
foreach ($_POST as $key => $value) {
if (isset($fields[$key])) {
$emailText .= "$fields[$key]: $value\n";
}
}
mail($sendTo, $subject, $emailText, "From: " . $from);
$responseArray = array('type' => 'success', 'message' => $okMessage);
}
catch (\Exception $e)
{
$responseArray = array('type' => 'danger', 'message' => $errorMessage);
}
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
$encoded = json_encode($responseArray);
header('Content-Type: application/json');
echo $encoded;
}
else {
echo $responseArray['message'];
}
Gracias por la ayuda.