Jump to content


Photo

Help using Captcha please :)


  • Please log in to reply
3 replies to this topic

#1 will roberts

will roberts
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 March 2006 - 08:48 AM

Hi all,

i am trying to implement captcha into my existing forms but am coming across a few problems so i am looking for a little help if you could :)

I WILL HAPPILY PAY ANYBODY TO IMPLEMENT THIS FOR ME AS I AM AT MY WITS END
this is my form
<form enctype='multipart/form-data' action='forms/contact_main/process.php' method='POST'>
        <table width="100%">
          <tr> 
            <td> Name<span class="fill_in">*</span> </td>
            <td> 
              <input type='text' name='name' class="form" size="35" />
            </td>
          </tr>
          <tr> 
            <td> E-mail<span class="fill_in">*</span> </td>
            <td> 
              <input type='text' name='email' class="form" size="35" />
            </td>
          </tr>
          <tr>
            <td>Telephone Number</td>
            <td> 
              <input type='text' name='telephonenumber' class="form" size="35" />
            </td>
          </tr>
          <tr> 
            <td valign="top">Message<span class="fill_in">*</span></td>
            <td> 
              <textarea name="message" cols="45" rows="8" class="form" ></textarea>
            </td>
          </tr>
          <tr>
            <td valign="top">Please enter security code exactly as written.</td>
            <td><img src="securimage_show.php"><br />
<input type="text" name="code" /><br /></td>
          </tr>
        </table>
        <div class="align"><input type='submit' value='Submit Form' class="form" />
       <input type='reset' value='Clear Form' class="form" /></div>
      </form>

and this is my process.php

<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','name');
pt_register('POST','email');
pt_register('POST','telephonenumber');
pt_register('POST','message');
pt_register('POST','image_code');
if($name=="" || $email=="" || $message=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="name: ".$name."
email: ".$email."
telephone number: ".$telephonenumber."
message: ".$message."
";
$message = stripslashes($message);
mail("sales@innotecmedia.co.uk","Contact Form (Innotec Media)",$message,"From: Innotec Media");
include("securimage.php");
  $img = new securimage();
  $valid = $img->check($_POST['code']);

  if($valid == TRUE) {
    echo "<center>Thanks, you entered the correct code.</center>";
  } else {
    echo "<center>Sorry, the code you entered was invalid.  <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>";
  }
?>

<!-- This is the content of the Thank you page, be careful while changing it -->
<h2>Thank You!!</h2>
<p>
        <img src="../../site_images/contact_phone.jpg" align="right" alt="Contact Us" />
        We will reply to your message at 
        the nearest opportunity, please make sure sales@innotecmedia.co.uk is 
        allowed in your spam filter if you have one to ensure you receive our 
        email.</p>
      <p>All emails sent from us will be sent from sales@innotecmedia.co.uk and are fully 
        scanned for viruses before being sent. If anybody contacts you stating 
        they are from Innotec Media by any email other than the one stated here, 
        please ignore it and remove it from your system as it may contain harmful 
        material.</p>
<p>If you think your PC may be infected by a virus or possible spyware and you are local, you can bring
it in to our store for a cleanup / diagnostics at a set price of £35.</p>
<p>We also do PC repairs and upgrades so if you have any problems just drop your machine in and we will do the rest.</p>
<!-- Do not change anything below this line -->

<?php 
}
?>

Now every time i test a form submit i get the thank you page and the image code error on the same page and the form still submits :(

So.... for some reason its not recognising the code entered and its carrying on with the rest of the form and submitting.

Please anybody im about to pull my hair out :)

#2 will roberts

will roberts
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 March 2006 - 07:39 AM

seems nobody knows much about captcha at the moment :(

Can't get this answered anywhere.

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 06 March 2006 - 12:08 PM

I've looked over your code a couple of times and couldn't really follow what it was trying to do ... but I know a bit about captchas. Enough to write a free, downloadable, complete, simple, script that does the same thing. You're welcome to use it - [a href=\"http://www.digitalmidget.com/php_noob/captcha.php\" target=\"_blank\"]demo/download here[/a] - if your's refuses to play nicely.
Legend has it that reading the manual never killed anyone.
My site

#4 will roberts

will roberts
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 March 2006 - 02:35 PM

[!--quoteo(post=352042:date=Mar 6 2006, 12:08 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Mar 6 2006, 12:08 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I've looked over your code a couple of times and couldn't really follow what it was trying to do ... but I know a bit about captchas. Enough to write a free, downloadable, complete, simple, script that does the same thing. You're welcome to use it - [a href=\"http://www.digitalmidget.com/php_noob/captcha.php\" target=\"_blank\"]demo/download here[/a] - if your's refuses to play nicely.
[/quote]

Would it be possible to implement that into my existing form for me?

I would gladly pay you of course. please add me to msn if you have it will@getskinned.co.uk

The original code i will send you for the forms is much more simple than the one i have posted.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users