Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1

    Exclamation Best captcha script?

    Hello,

    I am currently in the process of implementing a schedule form for a website that does home inspections. I have all aspects of the form complete, but I was wondering what would be the best & easiest captcha script to use? I've tried several different ones trying to get them to work, they either worked & work buggy or didnt work at all... Anyone got any suggestions?

    Thanks
    JustonG

  2. #2
    Join Date
    Mar 2009
    Location
    CA
    Posts
    9,350
    Have you tried hotscripts.com :-)
    〓〓 RackNerd LLC - Introducing Infrastructure Stability
    〓〓 Dedicated Servers, Private Cloud, DRaaS, Colocation, VPS, DDoS Mitigation, Shared & Reseller Hosting
    〓〓 www.linkedin.com/in/dustincisneros/
    〓〓 My fancy email dustin@racknerd.com

  3. #3
    Yes I have, thats where I found the first 10 that didnt work right

  4. #4
    Join Date
    Aug 2002
    Location
    Canada!
    Posts
    161
    reCaptcha is pretty good and a lot of people use it now.

    http://recaptcha.net/

  5. #5
    I tried that one. I can get it to work on my test server locally, but it wont work on my production server

  6. #6
    Join Date
    Jul 2005
    Location
    New Jersey, US
    Posts
    1,597
    Try checking out http://www.captcha.net/ I know several people using their software
    PlatinumServerManagement (also known as PSM)
    The OLDEST and LARGEST and MOST TRUSTED server management provider in the USA, with 15+ employees and growing!
    Providing quality support for OVER 21 years! Currently supporting over 3,000+ servers monthly!

    www.PlatinumServerManagement.com Proud member of the NJ BBB & Chamber of Commerce & Authorized cPanel Partner.

  7. #7
    I tried that one too I can get it to work on my test server locally, but it wont work on my production server

  8. #8
    ReCaptcha is the best. You need to do some debug and find which stage it fails.

  9. #9
    Another vote for reCaptcha. If it's not working on your production server, you must be doing something wrong, or your production VPS is not configured correctly. Many people use reCaptcha and it works fine for them. If you haven't noticed, since all of these Captcha scripts seem to not be working for you, you probably are missing an important package that needs to be installed. Example: GD, ImageMagic, etc.

  10. #10
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,382
    I implement Securimage on most of my projects and it has always worked flawlessly.

    http://www.phpcaptcha.org/

  11. #11
    Quote Originally Posted by kcackler View Post
    I implement Securimage on most of my projects and it has always worked flawlessly.

    http://www.phpcaptcha.org/

    Maybe im going about this this wrong way. Is there any chance you can help me add this to my existing form? I've been trying and apparently im not doing something right.

    Here is my form
    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Schedule Your Home Inspection Appointment</title>
    
    
    	<SCRIPT LANGUAGE="JavaScript" SRC="scripts/CalendarPopup.js"></SCRIPT>
    	<SCRIPT LANGUAGE="JavaScript">
    	var cal = new CalendarPopup();
    	</SCRIPT></head>
    
    <body>
    
    <p align="center" style="margin-top: 0; margin-bottom: 1"><b><font face="Arial">
    Schedule Your Home Inspection Appointment</font></b></p>
    <p align="center" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">
    <font face="Arial" style="font-size: 11pt">Our online 24/7 Home Inspection 
    Scheduler is fast and easy to use.</font></p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">
    <font face="Arial" style="font-size: 11pt">Please provide your information on 
    the form below. </font></p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">
    <font face="Arial" style="font-size: 11pt">We will confirm your request by 8pm 
    or by 9am the following day.</font></p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    <form NAME="example" method="POST" action="webquery.php" >
      <p align="left" style="margin-top: 3; margin-bottom: 6">
      <font face="Arial" style="font-size: 11pt">I am the
      <select size="1" name="client">
      <option selected>Homeowner</option>
      <option>Buyer</option>
      <option>Agent</option>
      </select> booking this inspection</font></p>
      <p align="left" style="margin-top: 3; margin-bottom: 6">
      <font face="Arial" style="font-size: 11pt">Preferred inspection date: 
    
    <INPUT TYPE="text" NAME="date1" VALUE="" SIZE=18>
    
     </font>
      <font face="Arial" colo="blue" style="font-size: 9pt">
    <A style="text-decoration: none" HREF="#"
       onClick="cal.select(document.forms['example'].date1,'anchor1','MM/dd/yyyy'); return false;"
       NAME="anchor1" ID="anchor1"></b><font color="#00749F"><u><i>Calendar</i></u></font></A>
    
     </font></p>
      <p align="left" style="margin-top: 0; margin-bottom: 1">
      <font face="Arial" style="font-size: 11pt">Preferred inspection time:
      <select size="1" name="sch_time">
      <option selected>No Preference</option>
      <option>9:00 am To 12 Noon</option>
      <option>1:00pm To 4:30pm</option>
      </select></font></p>
      <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
      <p align="left" style="margin-top: 4; margin-bottom: 6"><b>
      <font face="Arial" style="font-size: 10pt" color="#FF0000">*</font><font face="Arial" style="font-size: 10pt">
      <u><font color="#FF0000">Indicates a required field.</font></u></font></b></p>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="281">
        <tr>
          <td width="45%" height="19"><b><font face="Arial" style="font-size: 11pt">
          Primary Contact</font></b></td>
          <td width="55%" height="19">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">First Name:</font></td>
          <td width="55%" height="22"><input type="text" name="f_name" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">Last Name:</font></td>
          <td width="55%" height="22"><input type="text" name="l_name" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="19">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">Phone Number:</font></td>
          <td width="55%" height="19">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <p style="margin: 0 15"><i><font face="Arial" style="font-size: 11pt">
          Business</font></i></td>
          <td width="55%" height="22"><input type="text" name="b_phone" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <p style="margin-left: 15; margin-right: 15"><i>
          <font face="Arial" style="font-size: 11pt">Residence</font></i></td>
          <td width="55%" height="22"><input type="text" name="h_phone" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <p style="margin-left: 15; margin-right: 15"><i>
          <font face="Arial" style="font-size: 11pt">Mobile</font></i></td>
          <td width="55%" height="22"><input type="text" name="m_phone" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">E-mail Address:</font></td>
          <td width="55%" height="22">
          <input type="text" name="email_addr" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Will you be attending?</font></td>
          <td width="55%" height="22"><select size="1" name="attend_opt">
          <option selected>Choose...</option>
          <option>Yes</option>
          <option>No</option>
          </select></td>
        </tr>
        <tr>
          <td width="45%" height="19">&nbsp;</td>
          <td width="55%" height="19">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="23"><b><font face="Arial" style="font-size: 11pt">
          Agent Information</font></b></td>
          <td width="55%" height="23">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="22"><font face="Arial" style="font-size: 11pt">Is 
          a Real Estate Agent involved?</font></td>
          <td width="55%" height="22"><select size="1" name="agent_opt">
          <option selected>Choose...</option>
          <option>Yes</option>
          <option>No</option>
          </select></td>
        </tr>
        <tr>
          <td width="45%" height="19"><font face="Arial" style="font-size: 11pt">
          Agent First Name:</font></td>
          <td width="55%" height="19">
          <input type="text" name="agent_fname" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="19"><font face="Arial" style="font-size: 11pt">
          Agent Last Name:</font></td>
          <td width="55%" height="19">
          <input type="text" name="agent_lname" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="19"><font face="Arial" style="font-size: 11pt">
          Agent's Office:</font></td>
          <td width="55%" height="19"><input type="text" name="o_name" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="15"><font face="Arial" style="font-size: 11pt">
          Agent Mobile:</font></td>
          <td width="55%" height="15">
          <input type="text" name="agent_mobile" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="10"></td>
          <td width="55%" height="10"></td>
        </tr>
        <tr>
          <td width="45%" height="20"><b><font face="Arial" style="font-size: 11pt">
          Property to be Inspected</font></b></td>
          <td width="55%" height="20">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="11">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">Property Address:</font></td>
          <td width="55%" height="11">
          <input type="text" name="prop_address" size="32"></td>
        </tr>
        <tr>
          <td width="45%" height="7">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">City/Town:</font></td>
          <td width="55%" height="7"><input type="text" name="city_town" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="5">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">House Age? (Approx. year built)</font></td>
          <td width="55%" height="5">
      <input type="text" name="age" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="8">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">House&nbsp; Size? (Approx sq 
          ft)</font></td>
          <td width="55%" height="8">
      <input type="text" name="size" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="11">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">House 
          Type?</font></td>
          <td width="55%" height="11">
      <font size="2" face="Verdana">
      <select size="1" name="type">
      <option selected>Choose..</option>
      <option>Single Detached</option>
      <option>Semi Attached</option>
      <option>Townhouse Condo</option>
      <option>Apartment Condo</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="7">
          <font face="Arial" style="font-size: 11pt"><font color="#FF0000">&nbsp;</font>House 
          Style?</font></td>
          <td width="55%" height="7">
      <font size="2" face="Verdana">
      <select size="1" name="style">
      <option selected>Choose..</option>
      <option>Bungalow</option>
      <option>Two Storey</option>
      <option>Three Storey</option>
      <option>Bi-Level</option>
      <option>Split-Level</option>
      <option>Other</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="1">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Home 
          Occupied?</font></td>
          <td width="55%" height="1">
      <font face="Verdana" size="2">
      <select size="1" name="occupied">
      <option selected>Yes</option>
      <option>No</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="5">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Utilities 
          Turned On?</font></td>
          <td width="55%" height="5">
      <font face="Verdana" size="2">
      <select size="1" name="utilities">
      <option selected>Yes</option>
      <option>No</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="1">
          <font face="Arial" style="font-size: 11pt">&nbsp;Basement Suite?</font></td>
          <td width="55%" height="1">
      <font size="2" face="Verdana">
      <select size="1" name="suite">
      <option>Yes</option>
      <option selected>No</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="20">
          <font face="Arial" style="font-size: 11pt">&nbsp;Garage? </font></td>
          <td width="55%" height="20">
      <font size="2" face="Verdana">
      <select size="1" name="garage">
      <option selected>Choose...</option>
      <option>None</option>
      <option>Attached</option>
      <option>Detached</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="8">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Number of 
          Furnaces?</font></td>
          <td width="55%" height="8">
      <font size="2" face="Verdana">
      <select size="1" name="furnace">
      <option selected>One</option>
      <option>Two</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="11">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Number of 
          Water Heaters?</font></td>
          <td width="55%" height="11">
      <font size="2" face="Verdana">
      <select size="1" name="water_heater">
      <option selected>One</option>
      <option>Two</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="13">
          <font face="Arial" style="font-size: 11pt">&nbsp;Boiler?</font></td>
          <td width="55%" height="13">
      <font size="2" face="Verdana">
      <select size="1" name="boiler">
      <option selected>No</option>
      <option>Yes</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="14">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Domestic/Radiant 
          Water?</font></td>
          <td width="55%" height="14">
      <font size="2" face="Verdana">
      <select size="1" name="water">
      <option selected>No</option>
      <option>Yes</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="22">&nbsp;</td>
          <td width="55%" height="22">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="9"><font face="Arial" style="font-size: 11pt">How 
          did you hear about us?</font></td>
          <td width="55%" height="9"><select size="1" name="about_us">
      <option selected>Choose...</option>
      <option>Our Website</option>
      <option>Previous Client</option>
      <option>Friend Referral</option>
      <option>Agent Referral</option>
      <option>Google Search</option>
      <option>Yahoo Search</option>
      <option>Advertising</option>
      <option>Other</option>
      </select></td>
        </tr>
        <tr>
          <td width="45%" height="10"><font face="Arial" style="font-size: 11pt">If 
          you choose other, please specify:</font></td>
          <td width="55%" height="10"><font face="Verdana" size="2"> <input type="text" name="specify" size="20"></font></td>
        </tr>
        <tr>
          <td width="45%" height="10"></td>
          <td width="55%" height="10"></td>
        </tr>
        <tr>
          <td width="100%" height="7" colspan="2">
          <p style="margin-top: 2; margin-bottom: 2">
          <font face="Arial" style="font-size: 11pt">Questions or Comments?</font></p>
          <p style="margin-top: 2; margin-bottom: 2">
      <textarea rows="7" name="comments" cols="42"></textarea><p style="margin-top: 2; margin-bottom: 2">
      &nbsp;<p style="margin-top: 2; margin-bottom: 2">
      <font face="Arial" size="5">Are you Human?</font><p style="margin-top: 2; margin-bottom: 2">
      &nbsp;<p style="margin-top: 2; margin-bottom: 2">
      <b><font face="Arial" style="font-size: 11pt">
     <br></font></b></td>
        </tr>
      </table>
      <p align="left" style="margin-top: 0; margin-bottom: 1">
      &nbsp;</p>
      <p align="left" style="margin-top: 0; margin-bottom: 1">
      <input type="submit" value="Submit Request" name="B1"><input type="reset" value="Reset Form" name="B2"></p>
    </form>
    <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    
    </body>
    
    </html>
    Here is the part that sends the email
    Code:
    <?php
    //header("Location: http://www.scopehomeinspections.com/");
    
    $headers = 'MIME-Version: 1.0' . "\r\n";
    
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    $headers .= 'From: ' .$_POST['email_addr']. "\r\n";
    
    $headers .= "Reply-To: rcfort@telus.net\r\n";
    
    $mail_to = "jginfl@cfl.rr.com";
    
    $mail_subject = "Home Inspection Reqest";
    
    $mail_body .= "\n <b><u>Person Scheduling Appointment:</u></b>  " .$_POST['client']. "\n";
    $mail_body .= "\n <b><br>Preferred Date:</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['date1']. "\n";
    $mail_body .= "\n <b><br>Preferred Time:</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['sch_time']. "\n";
    
    $mail_body .= "\n <br><br><font color='red'><u>Primary Contact</font></u>:<br> \n";
    $mail_body .= "\n <b>Name</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['f_name']. " " .$_POST['l_name']. "\n";
    $mail_body .= "\n <br><b>Email</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['email_addr']. "\n";
    $mail_body .= "\n <br><br><b>Phone:</b> \n";
    $mail_body .= "\n <br>- Business:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['b_phone']. "\n";
    $mail_body .= "\n <br>- Residence:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['h_phone']. "\n";
    $mail_body .= "\n <br>- Mobile:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['m_phone']. "\n";
    
    $mail_body .= "\n <br><br><b>Will you be attending?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['attend_opt']. "\n";
    
    $mail_body .= "\n <br><br><font color='red'><u>Agent Information:</u></font><br> \n";
    $mail_body .= "\n <b>Is a Real Estate Agant Involved?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['agent_opt']. "\n";
    $mail_body .= "\n <br><b>Agent Name</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['agent_fname']. " " .$_POST['agent_lname']. "\n";
    $mail_body .= "\n <br><b>Office Name</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['o_name']. "\n";
    $mail_body .= "\n <br><b>Agent Mobile</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['agent_mobile']. "\n";
    
    $mail_body .= "\n <br><br><font color='red'><u>Property to be Inspected:</u></font><br> \n";
    $mail_body .= "\n <br><b>Property Address</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['prop_address']. "\n";
    $mail_body .= "\n <br><b>City/Town</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['city_town']. "\n";
    $mail_body .= "\n <br><b>Home Type</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['type']. "\n";
    $mail_body .= "\n <br><b>Home Style</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['style']. "\n";
    $mail_body .= "\n <br><b>Home Age</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['age']. "\n";
    $mail_body .= "\n <br><b>Home Size:</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['size']. "\n";
    $mail_body .= "\n <br><b>Basement Suite</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['suite']. "\n";
    $mail_body .= "\n <br><b>Garage</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['garage']. "\n";
    $mail_body .= "\n <br><b>Furnace</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['furnace']. "\n";
    $mail_body .= "\n <br><b>Water Heater</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['water_heater']. "\n";
    $mail_body .= "\n <br><b>Boiler</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['boiler']. "\n";
    $mail_body .= "\n <br><b>Radiant/Domestic Water</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['water']. "\n";
    $mail_body .= "\n <br><b>Is the home occupied?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['occupied']. "\n";
    $mail_body .= "\n <br><b>Are the utilities on?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['utilities']. "\n";
    
    $mail_body .= "\n <br><br><b>How did you hear about us?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['about_us']. "\n";
    $mail_body .= "\n <br><b>If other, Please specify</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['specify']. "\n";
    
    $mail_body .= "\n <br><br><b>Please leave your comments:</b><br>" .$_POST['comments']. "\n";
    
    
    mail($mail_to, $mail_subject, $mail_body, $headers);      
    
    
    ?>
    <html>
    <head>
    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.scopehomeinspections.com/thankyou.asp">
    </head>
    </html>
    I've tried following the instructions from secure image & I guess im not understanding. So any help would be greatful.

    Thank you
    JustonG

  12. #12
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,382
    Can you tell me what is going wrong in the process? Is it not generating the captcha image? Is the captcha code not working (IE, you enter the correct code, but it says you entered the incorrect code)?

    One thing that I noticed missing is session_start(); You HAVE to start the PHP session on both the form page and the form processing page before ANYTHING is sent to the browser (IE the first line of your script).

  13. #13
    I've tried playing with "session_start();" and other things...

    Sometimes it generates the code sometimes it dont, and when i do get it to generate the code, it allows the form to submit if you enter the wrong code or no code at all

  14. #14
    Okay I got one to work, but I need a way to refresh the captcha image, I've tried different things but it refreshes the entire page & resets the form.

    Got any suggestions?

  15. #15
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,382
    Code:
    <a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false">Reload Image</a>
    The above code will refresh the image, if the image is being called by secureimage_show.php

    Kevin

  16. #16
    well, the one im using isnt the one from secure image, it calls everything from a file called _image.php, heres what it looks like

    http://www.g3-services.com/scope/


    im just trying to figure out how to refresh the image & not the whole page

  17. #17
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,382
    Right - So take the code that I posted and replace the secureimage.php part with whatever the filename is for your current captcha program (IE _image.php)

  18. #18
    okay I tried this:

    Code:
    <a href="#" onclick="document.getElementById('captcha').src = '_image.php?' + Math.random(); return false">Reload Image</a>
    Didnt work

    Heres the script im using maybe you could help figure out what I need to adjust

    _image.php
    Code:
    <? 
    /***********************************************
     * Honso_CAPTCHA (v1.0): HonsoWorld (http://www.honsoworld.com)
     * Taylor Honsowetz (taylor@honsoworld.com)
     *
     * You may use this for personal or commercial use and You may modify it for your needs
     * You can NOT re-sell or re-distribute this, and you can NOT claim this as your own. 
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     * 
    ***********************************************/
    
    session_start();
    header("Content-Type: image/jpeg");
    die(create_image());
    function create_image()
    {$md5 = md5(rand(0,9999));
    $pass = substr($md5, 25, 5);
    $_SESSION["pass"] = $pass;
    $image = ImageCreatetruecolor(100, 25);
    $color_1 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_2 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_3 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_4 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_5 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_6 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_7 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_8 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_9 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_10 = ImageColorAllocate($image, rand(0,255), rand(0,255), rand(0,255));
    $color_text = ImageColorAllocate($image, 255, 255, 255);
    $color_bg = ImageColorAllocate($image, rand(1,180), rand(1,180), rand(1,180));
    imagefill($image, 0, 0, $color_bg);
    imagefontheight(50);
    imagefontwidth(50);
    imageline($image, rand(1,7), rand(1,7), rand(30,60), rand(10,30), $color_1);
    imageline($image, rand(50,65), rand(1,7), rand(10,100), rand(15,40), $color_2);
    imageline($image, rand(30,42), rand(3,14), rand(10,100), rand(20,30), $color_3);
    imageline($image, rand(12,25), rand(50,60), rand(20,80), rand(30,50), $color_4);
    imageline($image, rand(20,50), rand(11,29), rand(1,100), rand(10,80), $color_5);
    imageline($image, rand(1,7), rand(1,7), rand(30,60), rand(10,30), $color_6);
    imageline($image, rand(50,65), rand(1,7), rand(10,100), rand(15,40), $color_7);
    imageline($image, rand(30,42), rand(3,14), rand(10,100), rand(20,30), $color_8);
    imageline($image, rand(12,25), rand(50,60), rand(20,80), rand(30,50), $color_9);
    imageline($image, rand(20,50), rand(11,29), rand(1,100), rand(10,80), $color_10);
    imagestring($image, 5, rand(15,40), 5, $pass, $color_text);
    return imagejpeg($image);
    imagedestroy($image);
    }
    ?>
    captcha.php

    Code:
    <?
    /***********************************************
     * Honso_CAPTCHA (v1.0): HonsoWorld (http://www.honsoworld.com)
     * Taylor Honsowetz (taylor@honsoworld.com)
     *
     * You may use this for personal or commercial use and You may modify it for your needs
     * You can NOT re-sell or re-distribute this, and you can NOT claim this as your own. 
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     * 
    ***********************************************/
    
    //Start Session//
    	session_start();
    //Makes Sure You Go Through The HTML Form//
    	if ($_SERVER["REQUEST_METHOD"] <> "POST")
    	die("You must enter through the html form.");
    //Sets $captcha Variable//
    	if ($_POST["captcha"] != $_SESSION["pass"]) $captcha = "no";
    	if ($_POST["captcha"] == $_SESSION["pass"]) $captcha = "yes";
    
    //Action for Correct/Incorrect CAPTCHA//
    	if ($captcha == "no") echo("You have entered the wrong code.");
    	if ($captcha == "yes") echo("Your have entered the rigth code!");
    
    ?>

  19. #19
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,382
    What does your HTML form look like. It should be something like (for the captcha part)

    <img src="_image.php" id="captcha">

    The important part is the id="captcha" - That must be there in order for the javascript refresh to wrok.

  20. #20
    nevermind I just tested the script. It still submits even if you enter the wrong code

    I can not for the life of me figure what the hell im doing wrong and this captcha script is one I paid for


    they never make these damn things easy

  21. #21
    Okay I got this this thing to work, but now I have another small issue...

    As the form goes right now, A user fills out the form, if they enter all the information required and enters the CORRECT captcha code, the form submits perfect, fine, great.

    But the problem lies when a user enters the WRONG captvha code, it goes to a page that states "wrong code" then resets the form. Is there a way I can take that & make it like a Javascript popup that says "Wrong Validation Code"?

    Heres is the form & the emailer:

    The Form:
    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Schedule Your Home Inspection Appointment</title>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original:  Wayne Nolting (w.nolting@home.com) -->
    
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    function verify() {
    var themessage = "You are required to complete the following fields: ";
    if (document.example.f_name.value=="") {
    themessage = themessage + " - First Name";
    }
    if (document.example.l_name.value=="") {
    themessage = themessage + " -  Last Name";
    }
    if (document.example.h_phone.value=="") {
    themessage = themessage + " -  Residence Phone";
    }
    if (document.example.email_addr.value=="") {
    themessage = themessage + " -  E-mail";
    }
    if (document.example.prop_address.value=="") {
    themessage = themessage + " -  Property Address";
    }
    if (document.example.city_town.value=="") {
    themessage = themessage + " -  City_Town";
    }
    if (document.example.age.value=="") {
    themessage = themessage + " -  Property Age";
    }
    if (document.example.size.value=="") {
    themessage = themessage + " -  Property Size";
    }
    if (document.example.captcha.value=="") {
    themessage = themessage + " -  Validation Code";
    }
    //alert if fields are empty and cancel form submit
    if (themessage == "You are required to complete the following fields: ") {
    document.form.submit();
    }
    else {
    alert(themessage);
    return false;
       }
    }
    //  End -->
    </script>
    
    	<SCRIPT LANGUAGE="JavaScript" SRC="scripts/CalendarPopup.js"></SCRIPT>
    	<SCRIPT LANGUAGE="JavaScript">
    	var cal = new CalendarPopup();
    	</SCRIPT></head>
    
    <body>
    
    <p align="center" style="margin-top: 0; margin-bottom: 1"><b><font face="Arial">
    Schedule Your Home Inspection Appointment</font></b></p>
    <p align="center" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">
    <font face="Arial" style="font-size: 11pt">Our online 24/7 Home Inspection 
    Scheduler is fast and easy to use.</font></p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">
    <font face="Arial" style="font-size: 11pt">Please provide your information on 
    the form below. </font></p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">
    <font face="Arial" style="font-size: 11pt">We will confirm your request by 8pm 
    or by 9am the following day.</font></p>
    <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    <form NAME="example" method="POST" action="webquery.php" onSubmit="return verify()">
      <p align="left" style="margin-top: 3; margin-bottom: 6">
      <font face="Arial" style="font-size: 11pt">I am the
      <select size="1" name="client">
      <option selected>Homeowner</option>
      <option>Buyer</option>
      <option>Agent</option>
      </select> booking this inspection</font></p>
      <p align="left" style="margin-top: 3; margin-bottom: 6">
      <font face="Arial" style="font-size: 11pt">Preferred inspection date: 
    
    <INPUT TYPE="text" NAME="date1" VALUE="" SIZE=18>
    
     </font>
      <font face="Arial" colo="blue" style="font-size: 9pt">
    <A style="text-decoration: none" HREF="#"
       onClick="cal.select(document.forms['example'].date1,'anchor1','MM/dd/yyyy'); return false;"
       NAME="anchor1" ID="anchor1"></b><font color="#00749F"><u><i>Calendar</i></u></font></A>
    
     </font></p>
      <p align="left" style="margin-top: 0; margin-bottom: 1">
      <font face="Arial" style="font-size: 11pt">Preferred inspection time:
      <select size="1" name="sch_time">
      <option selected>No Preference</option>
      <option>9:00 am To 12 Noon</option>
      <option>1:00pm To 4:30pm</option>
      </select></font></p>
      <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
      <p align="left" style="margin-top: 4; margin-bottom: 6"><b>
      <font face="Arial" style="font-size: 10pt" color="#FF0000">*</font><font face="Arial" style="font-size: 10pt">
      <u><font color="#FF0000">Indicates a required field.</font></u></font></b></p>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="281">
        <tr>
          <td width="45%" height="19"><b><font face="Arial" style="font-size: 11pt">
          Primary Contact</font></b></td>
          <td width="55%" height="19">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">First Name:</font></td>
          <td width="55%" height="22"><input type="text" name="f_name" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">Last Name:</font></td>
          <td width="55%" height="22"><input type="text" name="l_name" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="19">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">Phone Number:</font></td>
          <td width="55%" height="19">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <p style="margin: 0 15"><i><font face="Arial" style="font-size: 11pt">
          Business</font></i></td>
          <td width="55%" height="22"><input type="text" name="b_phone" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <p style="margin-left: 15; margin-right: 15"><i>
          <font face="Arial" style="font-size: 11pt">Residence</font></i></td>
          <td width="55%" height="22"><input type="text" name="h_phone" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <p style="margin-left: 15; margin-right: 15"><i>
          <font face="Arial" style="font-size: 11pt">Mobile</font></i></td>
          <td width="55%" height="22"><input type="text" name="m_phone" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">E-mail Address:</font></td>
          <td width="55%" height="22">
          <input type="text" name="email_addr" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="22">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Will you be attending?</font></td>
          <td width="55%" height="22"><select size="1" name="attend_opt">
          <option selected>Choose...</option>
          <option>Yes</option>
          <option>No</option>
          </select></td>
        </tr>
        <tr>
          <td width="45%" height="19">&nbsp;</td>
          <td width="55%" height="19">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="23"><b><font face="Arial" style="font-size: 11pt">
          Agent Information</font></b></td>
          <td width="55%" height="23">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="22"><font face="Arial" style="font-size: 11pt">Is 
          a Real Estate Agent involved?</font></td>
          <td width="55%" height="22"><select size="1" name="agent_opt">
          <option selected>Choose...</option>
          <option>Yes</option>
          <option>No</option>
          </select></td>
        </tr>
        <tr>
          <td width="45%" height="19"><font face="Arial" style="font-size: 11pt">
          Agent First Name:</font></td>
          <td width="55%" height="19">
          <input type="text" name="agent_fname" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="19"><font face="Arial" style="font-size: 11pt">
          Agent Last Name:</font></td>
          <td width="55%" height="19">
          <input type="text" name="agent_lname" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="19"><font face="Arial" style="font-size: 11pt">
          Agent's Office:</font></td>
          <td width="55%" height="19"><input type="text" name="o_name" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="15"><font face="Arial" style="font-size: 11pt">
          Agent Mobile:</font></td>
          <td width="55%" height="15">
          <input type="text" name="agent_mobile" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="10"></td>
          <td width="55%" height="10"></td>
        </tr>
        <tr>
          <td width="45%" height="20"><b><font face="Arial" style="font-size: 11pt">
          Property to be Inspected</font></b></td>
          <td width="55%" height="20">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="11">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">Property Address:</font></td>
          <td width="55%" height="11">
          <input type="text" name="prop_address" size="32"></td>
        </tr>
        <tr>
          <td width="45%" height="7">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">City/Town:</font></td>
          <td width="55%" height="7"><input type="text" name="city_town" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="5">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">House Age? (Approx. year built)</font></td>
          <td width="55%" height="5">
      <input type="text" name="age" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="8">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">* </font>
          <font face="Arial" style="font-size: 11pt">House&nbsp; Size? (Approx sq 
          ft)</font></td>
          <td width="55%" height="8">
      <input type="text" name="size" size="20"></td>
        </tr>
        <tr>
          <td width="45%" height="11">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">House 
          Type?</font></td>
          <td width="55%" height="11">
      <font size="2" face="Verdana">
      <select size="1" name="type">
      <option selected>Choose..</option>
      <option>Single Detached</option>
      <option>Semi Attached</option>
      <option>Townhouse Condo</option>
      <option>Apartment Condo</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="7">
          <font face="Arial" style="font-size: 11pt"><font color="#FF0000">&nbsp;</font>House 
          Style?</font></td>
          <td width="55%" height="7">
      <font size="2" face="Verdana">
      <select size="1" name="style">
      <option selected>Choose..</option>
      <option>Bungalow</option>
      <option>Two Storey</option>
      <option>Three Storey</option>
      <option>Bi-Level</option>
      <option>Split-Level</option>
      <option>Other</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="1">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Home 
          Occupied?</font></td>
          <td width="55%" height="1">
      <font face="Verdana" size="2">
      <select size="1" name="occupied">
      <option selected>Yes</option>
      <option>No</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="5">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Utilities 
          Turned On?</font></td>
          <td width="55%" height="5">
      <font face="Verdana" size="2">
      <select size="1" name="utilities">
      <option selected>Yes</option>
      <option>No</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="1">
          <font face="Arial" style="font-size: 11pt">&nbsp;Basement Suite?</font></td>
          <td width="55%" height="1">
      <font size="2" face="Verdana">
      <select size="1" name="suite">
      <option>Yes</option>
      <option selected>No</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="20">
          <font face="Arial" style="font-size: 11pt">&nbsp;Garage? </font></td>
          <td width="55%" height="20">
      <font size="2" face="Verdana">
      <select size="1" name="garage">
      <option selected>Choose...</option>
      <option>None</option>
      <option>Attached</option>
      <option>Detached</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="8">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Number of 
          Furnaces?</font></td>
          <td width="55%" height="8">
      <font size="2" face="Verdana">
      <select size="1" name="furnace">
      <option selected>One</option>
      <option>Two</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="11">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Number of 
          Water Heaters?</font></td>
          <td width="55%" height="11">
      <font size="2" face="Verdana">
      <select size="1" name="water_heater">
      <option selected>One</option>
      <option>Two</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="13">
          <font face="Arial" style="font-size: 11pt">&nbsp;Boiler?</font></td>
          <td width="55%" height="13">
      <font size="2" face="Verdana">
      <select size="1" name="boiler">
      <option selected>No</option>
      <option>Yes</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="14">
          <font face="Arial" style="font-size: 11pt" color="#FF0000">&nbsp;</font><font face="Arial" style="font-size: 11pt">Domestic/Radiant 
          Water?</font></td>
          <td width="55%" height="14">
      <font size="2" face="Verdana">
      <select size="1" name="water">
      <option selected>No</option>
      <option>Yes</option>
      </select></font></td>
        </tr>
        <tr>
          <td width="45%" height="22">&nbsp;</td>
          <td width="55%" height="22">&nbsp;</td>
        </tr>
        <tr>
          <td width="45%" height="9"><font face="Arial" style="font-size: 11pt">How 
          did you hear about us?</font></td>
          <td width="55%" height="9"><select size="1" name="about_us">
      <option selected>Choose...</option>
      <option>Our Website</option>
      <option>Previous Client</option>
      <option>Friend Referral</option>
      <option>Agent Referral</option>
      <option>Google Search</option>
      <option>Yahoo Search</option>
      <option>Advertising</option>
      <option>Other</option>
      </select></td>
        </tr>
        <tr>
          <td width="45%" height="10"><font face="Arial" style="font-size: 11pt">If 
          you choose other, please specify:</font></td>
          <td width="55%" height="10"><font face="Verdana" size="2"> <input type="text" name="specify" size="20"></font></td>
        </tr>
        <tr>
          <td width="45%" height="10"></td>
          <td width="55%" height="10"></td>
        </tr>
        <tr>
          <td width="100%" height="7" colspan="2">
          <p style="margin-top: 2; margin-bottom: 2">
          <font face="Arial" style="font-size: 11pt">Questions or Comments?</font></p>
          <p style="margin-top: 2; margin-bottom: 2">
      <textarea rows="7" name="comments" cols="42"></textarea><p style="margin-top: 2; margin-bottom: 2">
      &nbsp;<p style="margin-top: 2; margin-bottom: 2">
      <font face="Arial" size="5">Are you Human?</font><p style="margin-top: 2; margin-bottom: 2">
      &nbsp;<p style="margin-top: 2; margin-bottom: 2">
          <p style="margin-top: 6; margin-bottom: 6">
         
    <!-- Start Captcha -->         
    <img src="_image.php" width="115" height="34" /></p>
          <p style="margin-top: 6; margin-bottom: 6"><font face="Arial" size="2">
          Enter the Code Above</font><br><input type="text" name="captcha" size="15">
    <!-- End Captcha -->
    
      <b><font face="Arial" style="font-size: 11pt"><br></font></b></td>
        </tr>
      </table>
      <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;
      </p>
      <p align="left" style="margin-top: 0; margin-bottom: 1">
    <input type="submit" value="Submit Request" name="submit"><input type="reset" value="Reset Form" name="B2"></p>
    </form>
    <p align="left" style="margin-top: 0; margin-bottom: 1">&nbsp;</p>
    
    </body>
    
    </html>
    This is the part that validates the captcha code & sends the email
    Code:
    <?php session_start(); ?>
    <?
    //Makes Sure You Go Through The HTML Form//
    if ($_SERVER["REQUEST_METHOD"] <> "POST")
    die("You must enter through the html form.");
    //Sets $captcha Variable//
    if ($_POST["captcha"] != $_SESSION["pass"]) $captcha = "no";
    if ($_POST["captcha"] == $_SESSION["pass"]) $captcha = "yes";
    
    $headers = 'MIME-Version: 1.0' . "\r\n";
    
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    $headers .= 'From: ' .$_POST['email_addr']. "\r\n";
    
    $headers .= "Reply-To: rcfort@telus.net\r\n";
    
    $mail_to = "jginfl@cfl.rr.com";
    
    $mail_subject = "Home Inspection Reqest";
    
    $mail_body .= "\n <b><u>Person Scheduling Appointment:</u></b>  " .$_POST['client']. "\n";
    $mail_body .= "\n <b><br>Preferred Date:</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['date1']. "\n";
    $mail_body .= "\n <b><br>Preferred Time:</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['sch_time']. "\n";
    
    $mail_body .= "\n <br><br><font color='red'><u>Primary Contact</font></u>:<br> \n";
    $mail_body .= "\n <b>Name</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['f_name']. " " .$_POST['l_name']. "\n";
    $mail_body .= "\n <br><b>Email</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['email_addr']. "\n";
    $mail_body .= "\n <br><br><b>Phone:</b> \n";
    $mail_body .= "\n <br>- Business:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['b_phone']. "\n";
    $mail_body .= "\n <br>- Residence:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['h_phone']. "\n";
    $mail_body .= "\n <br>- Mobile:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['m_phone']. "\n";
    
    $mail_body .= "\n <br><br><b>Will you be attending?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['attend_opt']. "\n";
    
    $mail_body .= "\n <br><br><font color='red'><u>Agent Information:</u></font><br> \n";
    $mail_body .= "\n <b>Is a Real Estate Agant Involved?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['agent_opt']. "\n";
    $mail_body .= "\n <br><b>Agent Name</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['agent_fname']. " " .$_POST['agent_lname']. "\n";
    $mail_body .= "\n <br><b>Office Name</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['o_name']. "\n";
    $mail_body .= "\n <br><b>Agent Mobile</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['agent_mobile']. "\n";
    
    $mail_body .= "\n <br><br><font color='red'><u>Property to be Inspected:</u></font><br> \n";
    $mail_body .= "\n <br><b>Property Address</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['prop_address']. "\n";
    $mail_body .= "\n <br><b>City/Town</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['city_town']. "\n";
    $mail_body .= "\n <br><b>Home Type</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['type']. "\n";
    $mail_body .= "\n <br><b>Home Style</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['style']. "\n";
    $mail_body .= "\n <br><b>Home Age</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['age']. "\n";
    $mail_body .= "\n <br><b>Home Size:</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['size']. "\n";
    $mail_body .= "\n <br><b>Basement Suite</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['suite']. "\n";
    $mail_body .= "\n <br><b>Garage</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['garage']. "\n";
    $mail_body .= "\n <br><b>Furnace</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['furnace']. "\n";
    $mail_body .= "\n <br><b>Water Heater</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['water_heater']. "\n";
    $mail_body .= "\n <br><b>Boiler</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['boiler']. "\n";
    $mail_body .= "\n <br><b>Radiant/Domestic Water</b>:&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['water']. "\n";
    $mail_body .= "\n <br><b>Is the home occupied?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['occupied']. "\n";
    $mail_body .= "\n <br><b>Are the utilities on?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['utilities']. "\n";
    
    $mail_body .= "\n <br><br><b>How did you hear about us?</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['about_us']. "\n";
    $mail_body .= "\n <br><b>If other, Please specify</b>&nbsp;&nbsp;&nbsp;&nbsp;" .$_POST['specify']. "\n";
    
    $mail_body .= "\n <br><br><b>Please leave your comments:</b><br>" .$_POST['comments']. "\n";
    
    ////////////////////////////////////////////////////////
    
    //Action for Correct/Incorrect CAPTCHA//
    if ($captcha == "no") echo("<p>You have entered the wrong code.</p>");
    if ($captcha == "yes") mail($mail_to, $mail_subject, $mail_body, $headers); 
    if ($captcha == "yes") echo("<html>\n<head>\n\n<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=http://www.scopehomeinspections.com/thankyou.asp\">\n</head>\n</html>");
    ?>
    If anyone can point into a direction of what to change I would be VERY greatful!!

  22. #22
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,382
    Toward the bottom of your form processing script:

    PHP Code:
    if(captcha == 'no') {
      echo 
    '<script type="text/javascript">';
      echo 
    'alert("Wrong Validation Code.");';
      echo 
    'window.setTimeout(window.history.back(),0); ';
      echo 
    '</script>';

    It's not the best way to present your error to the user, but it works..

  23. #23
    Quote Originally Posted by kcackler View Post
    Toward the bottom of your form processing script:

    PHP Code:
    if(captcha == 'no') {
      echo 
    '<script type="text/javascript">';
      echo 
    'alert("Wrong Validation Code.");';
      echo 
    'window.setTimeout(window.history.back(),0); ';
      echo 
    '</script>';

    It's not the best way to present your error to the user, but it works..
    okay I tried that, but when i do the form & I enter the wrong caotcha, it just goes to a blank page, and I get this in my error log:
    [Thu Jul 02 15:30:30 2009] [error] [client 72.189.158.20] PHP Notice: Undefined variable: mail_body in /var/www/web1/web/scope/webquery.php on line 44, referer: http://www.g3-services.com/scope/sch2.php
    [Thu Jul 02 15:30:30 2009] [error] [client 72.189.158.20] PHP Notice: Use of undefined constant captcha - assumed 'captcha' in /var/www/web1/web/scope/webquery.php on line 88, referer: http://www.g3-services.com/scope/sch2.php
    If I use the correct captcha code, the form processes like it should.

    Why cant I have the code that checks the captcha on the form page and have it check then process the form?

    I'm fairly new to php & stuff as you can see, the captcha im trying to use i paid for, and i would really like to get it working completely and not halfway like it is, I tried emailing the author of the script but his emails keep coming back.

    I appreciate all the help ya'll are giving me!!!

  24. #24
    Join Date
    Nov 2007
    Location
    Dallas, TX
    Posts
    9,064
    I would also focus on finding one that is not *too* difficult to solve. I have run across some CAPTCHAs that are nearly impossible to answer as an end-user. :-/

    -mike
    Mike G. - Limestone Networks - Account Specialist
    Cloud - Dedicated - Colocation - Premium Network - Passionate Support
    DDoS Protection Available - Reseller Program @LimestoneInc - 877.586.0555

  25. #25
    The one I'm using is pretty cut & dry, easy to read & everything, I;m purposely entering the wrong code to make sure the correct error message is shown & stuff, but as i stated above trying to get that part of the code right is where im having problems

Page 1 of 2 12 LastLast

Similar Threads

  1. Form script with Captcha needed.
    By gounder in forum Employment / Job Offers
    Replies: 4
    Last Post: 12-16-2006, 04:46 PM
  2. Captcha
    By rockergirl in forum Programming Discussion
    Replies: 3
    Last Post: 06-15-2006, 04:49 PM
  3. A captcha
    By EVILISCIOUS in forum Other Offers & Requests
    Replies: 1
    Last Post: 03-21-2006, 04:39 AM
  4. captcha problems...
    By fromalk in forum Programming Discussion
    Replies: 2
    Last Post: 11-02-2005, 01:59 PM

Posting Permissions

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