ok, here is the index.php file
==========================================================
<html>
<head>
<title>Killbot Example</title>
</head>
<body>
<?
// The ONLY variable you should need to change is $mykey which must match $mykey in your captcha.php file
$mykey = "MYSECRETKEY"; // IMPORTANT!!! Your unique key. Must match $mykey in captcha.php
if ($POST)
{
$user_input = $POST['guess']; // The guess a user enters -- case sensitive
$newcode = $_POST['code'] . $mykey; // Combine the hidden code field with $mykey
$key = substr(md5($newcode), 0, 5); // Encrypt it and take first five characters
if ($key == $user_input) // USER SUCCESSFULLY VALIDATED
{
echo "<hr /><h3>CONGRATULATIONS, YOU PASSED! You are a real, live person (or at least close). If this had been an ";
echo "actual form then your input would be headed somewhere right now.</h3>";
echo "The data you entered: <br />";
echo "<b>Name:</b> " . htmlentities($_POST[name]) . "<br />";
echo "<b>Comment:</b>" . htmlentities($_POST[comment]) . "<hr />";
}
else // USER UNSUCCESSFULLY VALIDATED
{
echo "<hr /><h3>SORRY, YOU FAILED. You did not properly fill out the form. Please try again.</h3><hr />";
}
}
?>
<h3>NotOneBit.com Killbot Form</h3>
<?
$rand_loop = rand(5, 10); // Pick length of random string
$string = ''; // Initialize string
for($i = 1; $i <= $rand_loop; $i++)
{
$rand1 = rand(48, 57); //0-9
$rand2 = rand(65, 90); //A-Z
$rand3 = rand(97, 122); //a-z
$rand_picker = rand(1, 3); // use rand 1, 2 or 3
switch ($rand_picker) {
case 1:
$string .= chr($rand1);
break;
case 2:
$string .= chr($rand2);
break;
case 3:
$string .= chr($rand3);
break;
}
}
?>
<form action="<?=$PHP_SELF?>" method="POST">
<p>If you find the image too difficult to read, simply reload the page for a new one.</p>
<table border="1" cellpadding="4" cellspacing="0" align="center" bordercolor="#C0C0C0" style="border-collapse: collapse">
<tr>
<td align="right">Enter Your Name:</td>
<td>
<input type="text" name="name" size="25">
</td>
</tr>
<tr>
<td align="right">Enter A Comment:</td>
<td>
<textarea rows="4" name="comment" cols="20"></textarea>
</td>
</tr>
<tr>
<td align="right">Please enter the text in the image exactly<br />as it appears in the box to the right.
<br /><img border="2" src="captcha.php?<?=$string?>"></td>
<td valign="top"><input type="text" size="5" name="guess"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="hidden" name="code" value="<?=$string?>"><input type="submit"></td>
</tr>
</table>
</form>
</body>
</html>
Now I've tried combining the sections with the if statements ( doing my best to preserve syntax from my days of C++ programming ) and then inserting my tables and input boxes for the lower form section, but for some reason combining the if statements causes an error within those lines and adding in my tables and entry fields causes the user validated / user failed sections to appear when you first load the form.
ideally, I'd like to keep the registration information sent message, and something similar with the please verify all information portion of the code, with a back button to reload the input fields.
Your help is much appreciated by the way, I hope there is something I can do in return ( except php stuff lol )