I think I have it working now... going by the <form method="post"... you were right, it was post and I looked in my gdform.php file, and noticed I had it set as $GET so changed that to $POST. Now, if I enter the wrong information, I get the landing page of "You have entered the incorrect code, please try again" and created a thankyou.php file for on success. I'd love to learn how to get a pop-up box for on successful submission, kinda like how using the javascript if they do not enter a required field, it asks you to fill those in, but my brain is about fried from the last 3 days of struggling with this lol. Thank you very much for the help jwagner, and pointing out those newbie mistakes.
Hopefully, one day I'll be able to just write all my own code and know enough not to run into these problems ;-)
Here is the final code of the 3 pages I'm using (index2.htm, gdform2.php, and thankyou.php). If you get some time, please look over them to make sure I did not mess up in fixing it...thanks!!
Index2.htm (everything from <form> to </form>)
<form method="post" id="contactform" action="gdform2.php" onsubmit="return formCheck(this);">
<div>
<p>All required fields are denoted by an asterix (<span class="required style4">*</span>).</p>
<fieldset>
<legend>Your Details</legend>
<label for="contact_name">Your Name <span class="required style4">*</span></label>
<br />
<input type="text" id="contact_name" name="Name" size="30" />
<br />
<label for="contact_email">Your Email <span class="required style4">*</span></label>
<br />
<input type="text" id="contact_email" name="E-Mail" size="30" />
<br />
<label for="contact_phone">Your Telephone Number <span class="required style4">*</span></label>
<br />
<input type="text" id="contact_phone" name="Phone" size="30" />
<br />
<label for="best_time">Best time to contact you</label>
<br />
<select id="best_time" name="best_time">
<option value="">Choose a time</option>
<option value="Morning">Morning 8a-11a</option>
<option value="Afternoon">Afternoon 12p-5p</option>
<option value="Evening">Evening 5p-9p</option>
</select>
</fieldset>
<fieldset>
<legend>Your Comment</legend>
<label for="contact_comment">Comment Text</label>
<br />
<textarea name="comment" cols="35" rows="5" id="contact_comment"></textarea>
</fieldset>
<img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" />
<input type="text" name="captcha_code" size="8" maxlength="6" />
<a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false">Reload Image</a>
<br />
<input type="hidden" name="sendcontact" value="Contact Sent" />
<input type="hidden" name="redirect" value="thankyou.php" />
<input type="submit" value="Send Email" />
</div>
</form>
gdform2.php
<?php session_start();
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET")
{
$query_vars = $_GET;
}
elseif ($request_method == "POST")
{
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$file = $_SERVER['DOCUMENT_ROOT'] . "\ssfm\gdform_" . $t;
$fp = fopen($file,"w");
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// handle the error accordingly with your other error checking
// or you can do something really basic like this
die('The code you entered was incorrect. Go back and try again.');
}
while (list ($key, $val) = each ($query_vars))
{
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\r\n");
fputs($fp,"$val\r\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\r\n");
if ($key == "redirect")
{
$landing_page = $val;
}
}
fclose($fp);
if ($landing_page != "")
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
}
else
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
?>
thankyou.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo"Thank you for your submission! We will be in touch soon. Please click your browser's Back button to return to the website.".$_GET['number']."|";
?>
</body>
</html>