Jump to content

helenS

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by helenS

  1. Below is my contact from - and I have set anti spam question as I don't like captcha. How to I code the post/human bit so it is case insensitive?
    I am a designer so I don't know what I am doing ☹️.

     

    <div class="one-half-column-right" id="contactform">
     <form method="post" action="index.php#contactform">
    <label>Name*</label>
    <div class="clear"></div>
    <input name="name" placeholder="Type Here">
     <label>Email*</label>
     <div class="clear"></div>
          <input name="email" type="email" placeholder="Type Here">
    <label>Message</label>
    <textarea name="message" placeholder="Type Here"></textarea>
     <label>*If today is Tuesday, what is tomorrow? <br> [lowercase answer please]<br> (Anti-spam)</label>
    <input name="human" placeholder="Type Here">
    <input id="submit" name="submit" type="submit" value="Submit">
    </form>
     <?php
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        $from = 'From: Website Form'; 
        $to = name@name.com’; 
        $subject = 'website form enquiry';
        $human = $_POST['human'];
    
    
    $headers .= 'From: '.$from."\r\n".
        'Reply-To: '.$from."\r\n" .
        'X-Mailer: PHP/' . phpversion();
        $body = "From: $name\n E-Mail: $email\n Message:\n $message";
                    
        if ($_POST['submit'] && $human == wednesday’) {    
            if (mail ($to, $subject, $body, $from)) { 
            echo '<p style="font-family: Montserrat, Helvetica, Arial, sans-serif; font-weight: 600; text-align:center; font-size: 16px; color: #000; text-transform: uppercase; background-color: #FFD700"> 
    
         
          Request has been sent. We will get back to within 48 hours!<br></p>';
    
        } else { 
            echo '<p style="font-family: Montserrat, Helvetica, Arial, sans-serif; font-weight: 600; text-align:center; font-size: 16px; color: #000; text-transform: uppercase; background-color: #FFD700"> 
    
           Something went wrong, go back and try again!</p>'; 
        } 
        } else if ($_POST['submit'] && $human != '') {
        echo '<p style="font-family: Montserrat, Helvetica, Arial, sans-serif; font-weight: 600; text-align:center; font-size: 16px; color: #000; text-transform: uppercase; background-color: #FFD700"> 
        You answered the anti-spam question incorrectly!</p>';
        }
    ?>
        <!--// form //-->


        

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.