Results 1 to 2 of 2

Thread: Contact form

  1. #1
    Junior Member
    Join Date
    Oct 2015

    Contact form


    I have created a contact form but I cannot seem to get it working.

    Within the html I have this

    HTML Code:
    <form class="form-horizontal" role="form">
              <div class="form-group">
                    <label for="contact-name" class="col-sm-2 control-label">Name</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" id="contact-name" placeholder="First and Last Name">          
                        <div class="form-group">
                    <label for="contact-email" class="col-sm-2 control-label">Email</label>
                  <div class="col-sm-10">
                    <input type="email" class="form-control" id="contact-email" placeholder="">          
                                  <div class="form-group">
                    <label for="contact-message" class="col-sm-2 control-label">Message</label>
                  <div class="col-sm-10">
                          <textarea class="form-control" rows="4"></textarea>  
        <button type="submit" class="btn btn-primary">Send</button>
    then in contact.php I have the following

    PHP Code:
    -name $_POST['contact-name'];
    $contact-email $_POST['contact-email'];
    $contact-message $_POST['contact-message'];
    $from 'From: TangledDemo'
    $to ''
    $subject 'Hello';
    $human $_POST['human'];
    $body "From: $name\n E-Mail: $email\n Message:\n $message";
        if (
    $_POST['submit'] && $human == '4') {                 
            if (
    mail ($to$subject$body$from)) { 
    '<p>Your message has been sent!</p>';
        } else { 
    '<p>Something went wrong, go back and try again!</p>'
        } else if (
    $_POST['submit'] && $human != '4') {
    '<p>You answered the anti-spam question incorrectly!</p>';
    However it does not seem to work any ideas?

    Kind Regards

  2. #2
    HTML,CSS and JS thread not PHP related

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts