Hi and many thanks for your reply.
Having some problems intgrating the script into my form, help please if you can.
Atthe top of my page I have:
<?php // The following three lines must be at the top of your script.
session_start();
define('CAPTCHA_PATH', $_SERVER['DOCUMENT_ROOT'].'/captcha/'); // Path to captcha
require_once(CAPTCHA_PATH.'captcha.php');
?>
some mor html and then the form.
<form action="<?php $captcha = captcha_validate();?> <?php echo $editFormAction; ?>" method="post" name="form2" id="form2">
<table align="center">
<tr valign="baseline">
<td width="67" align="right" nowrap="nowrap" class="bodytext">Id:</td>
<td width="277" colspan="2" class="chargesformtext"><input type="text" name="id" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"><div align="right">Name:</div></td>
<td colspan="2" class="chargesformtext"><input type="text" name="name" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"><div align="right">Date:</div></td>
<td colspan="2" class="chargesformtext"><input name="inputdate" type="text" value="<?php echo date("F d,Y", $now) ?>" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"><div align="right">Comment:</div></td>
<td colspan="2" class="chargesformtext"><input type="text" name="comment" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"><div align="right">Email:</div></td>
<td colspan="2" class="chargesformtext"><input type="text" name="email" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"> </td>
<td colspan="2" class="chargesformtext"> </td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"> </td>
<td colspan="2" class="chargesformtext">Please enter the code below into the text feild. </td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="bodytext"><div align="right"></div></td>
<td colspan="2">
<?php if(isset($_POST['captcha'])){
if(captcha_validate()){
print '<p>Success! <br>You entered the correct code! <br><a href="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'">Here\'s another one to try!</a></p>';
}else{
print '<p>Failure! <br>You entered the wrong code! <br><a href="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'">Here\'s another one to try!</a></p>';
}
}else{
print '<div style="float: left;"><img id="mainimage" style="border: 1px solid #555;" src="http://'.$_SERVER['HTTP_HOST'].
$_SERVER['PHP_SELF'].'?image" width="140" height="90" alt="CAPTCHA image">'."\n".
'<br>I can\'t read that image...<br>'."\n".
'<a href="#" onclick="document.getElementById(\'mainimage\').src=\'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?image=\' + new Date; return false;">give me an easier one!</a>'."\n".
'</div><form style="margin-top: 0; margin-bottom: 3px;" action="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'" method="post">'."\n".
'<input type="text" name="captcha" style="width: 100px; height: 24px; margin-top: 5px; border: 1px solid #555; margin-left: 10px; text-align: center;">'."\n".
'<span style="color: red;">*</span> <i>case sensitive</i><br>'."\n".
'<input type="submit" name="submit" value="Submit" style="width: 100px; height: 24px; margin-left: 10px; margin-top: 5px;">'."\n".
'</form><br><br><br><br>'."\n";
}
?></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form2" />
</form>
I have <?php $captcha = captcha_validate();?> in my form action and the other parts towards the end of the form.
Can you advise and help me.