0

Here is the HTML Code:

<form id="contactform" action="contact/contact.php" method="post" class="validateform" name="send-contact">
  <div id="sendmessage">
     Your message has been sent. Thank you!
  </div>
  <div class="row">
    <div class="col-lg-4 field">
      <input type="text" name="name" placeholder="* Enter your full name" data-rule="maxlen:4" data-msg="Please enter at least 4 chars" />
      <div class="validation">
      </div>
    </div>
    <div class="col-lg-4 field">
      <input type="text" name="email" placeholder="* Enter your email address" data-rule="email" data-msg="Please enter a valid email" />
      <div class="validation">
      </div>
    </div>
    <div class="col-lg-4 field">
      <input type="text" name="subject" placeholder="Enter your subject" data-rule="maxlen:4" data-msg="Please enter at least 4 chars" />
      <div class="validation">
      </div>
    </div>
    <div class="col-lg-12 margintop10 field">
      <textarea rows="12" name="message" class="input-block-level" placeholder="* Your message here..." data-rule="required" data-msg="Please write something"></textarea>
      <div class="validation">
      </div>
      <p>
        <button class="btn btn-theme margintop10 pull-left" type="submit">Submit message</button>
        <span class="pull-right margintop20">* Please fill all required form field, thanks!</span>
      </p>
    </div>
  </div>
</form>

Here is the PHP code:

<?php
/*
Credits: Bit Repository
URL: http://www.bitrepository.com/
*/

include 'config.php';

error_reporting (E_ALL ^ E_NOTICE);

$post = (!empty($_POST)) ? true : false;

if($post)
{

$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);

$error = '';

if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $message,
     "From: ".$name." <".$email.">\r\n"
    ."Reply-To: ".$email."\r\n"
    ."X-Mailer: PHP/" . phpversion());


if($mail)
{
echo 'OK';
}

}


}
?>

when i click submit on the page nothing happens, no email is sent any second opinions or another pair of eyes to look at it please? I think it may be a problem with the PHP, but i am not 100% sure. any help will do thanks!

ErasmoOliveira
  • 1,416
  • 2
  • 20
  • 40

0 Answers0