<?php session_start();
if((@$_POST['check']) == @$_SESSION['check']) {
echo"<script>window.location = '../thankyou.php'</script>";
}else{
echo"<center><font size=\"1\" face=\"tahoma\" color=\"black\">Wrong Security Text <a href=\"javascript:history.go(-1)\">Go Back</a></font></center>";
die();
}
but results in all the information that was initially typed in to be deleted. I obviously cannot make it so the captcha gets verified though javascript on serverside because that would do nothing to prevent bots. Is there a way that I can store the info type in by the user and have it automatically reload into the form if they get the security code wrong?Here is the direct link to the quote I made that I am having problems with. It would probably be easier to just go there and fill out the form with the wrong security code to see what I mean.
http://www.contracto...y.com/quote.php
Thanks so much, I am new to these forums and I will try to do anything in my power to help you guys help me
Here is the entire code of the .php file that you get redirected to after filling out the form:
<?php session_start();
if((@$_POST['check']) == @$_SESSION['check']) {
echo"<script>window.location = '../thankyou.php'</script>";
}else{
echo"<center><font size=\"1\" face=\"tahoma\" color=\"black\">Wrong Security Text <a href=\"javascript:history.go(-1)\">Go Back</a></font></center>";
die();
}
/* Subject and Email Variables */
$emailSubject = 'Customer: Request An Estimate';
$webMaster = 'xxxx@xxxx.com';
/* Gathering Data Variables */
$requestField = $_POST['request'];
$descriptionField = $_POST['message'];
$first_nameField = $_POST['first_name'];
$last_nameField = $_POST['last_name'];
$current_addressField = $_POST['current_address'];
$current_cityField = $_POST['current_city'];
$current_stateField = $_POST['current_state'];
$current_zipField = $_POST['current_zip'];
$current_address_lengthField = $_POST['current_address_length'];
$previous_addressField = $_POST['previous_address'];
$previous_cityField = $_POST['previous_city'];
$previous_stateField = $_POST['previous_state'];
$previous_zipField = $_POST['previous_zip'];
$primary_area_codeField = $_POST['primary_area_code'];
$primary_phone_numberField = $_POST['primary_phone_number'];
$secondary_area_codeField = $_POST['secondary_area_code'];
$secondary_phone_numberField = $_POST['secondary_phone_number'];
$email_addressField = $_POST['email_address'];
$best_contactField = $_POST['best_contact'];
$body = <<<EOD
<strong>$requestField ESTIMATE REQUEST</strong>
<br><hr><br>
<strong>REQUEST DETAILS:</strong>
<br>
<strong>Request is For:</strong> $requestField <br>
<strong>Type of Request:</strong> $typeField <br>
<strong>Description:</strong> $descriptionField <br>
<br>
<strong>Title:</strong> $titleField <br>
<strong>First Name:</strong> $first_nameField <br>
<strong>Last Name:</strong> $last_nameField <br>
<strong>Address:</strong> $addressField <br>
<strong>City:</strong> $cityField <br>
<strong>State:</strong> $stateField <br>
<strong>Postal Code:</strong> $zipField <br>
<br>
<strong>Best Way to Contact:</strong> $best_contactField <br>
<strong>Email Address:</strong> $email_addressField <br>
<strong>Contact Phone Number:</strong> ($primary_area_codeField)$primary_phone_numberField <br>
<strong>Evening Phone Number:</strong> ($secondary_area_codeField)$secondary_phone_numberField <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
EOD;
echo "$theResults";
?>
and here is the actual form page that the link i provided brings you to:
<div class="post">
<div class="entry">
<center>
<form id="form1" method="post" action="../scripts/contactforumprocess.php">
<table width="100%" border="0" cellpadding="6">
<tr>
<td width="53%" align="left"><label for="request"><strong>Request is for:</strong></label></td>
<td width="47%" align="left"><font color="#FF0000"><span id="spryselect1">
<select name="request" id="request">
<option value="">-- Please Select --</option>
<option value="Bathroom">Bathroom</option>
<option value="Kitchen">Kitchen</option>
<option value="Accessibility">Accessibility</option>
<option value="Windows">Windows</option>
<option value="Decks">Decks</option>
<option value="Siding">Siding</option>
<option value="Other">Other</option>
</select>
<span class="selectRequiredMsg">Required</span></span> *</font></td>
</tr>
<tr>
<td align="left"><label for="type"><strong>Type of Request:</strong></label></td>
<td align="left">
<font color="#FF0000"><span id="spryselect2">
<label for="type"></label>
<select name="type" id="type">
<option value="">-- Please Select --</option>
<option value="Estimate">Estimate</option>
<option value="Information">Information</option>
</select>
<span class="selectRequiredMsg">Required</span></span> *</font></td>
</tr>
<tr>
<td width="53%" align="left"><label for="message"><strong>Brief Description: </strong><br />
<font color="#999999">(Please include as much information as possible, including budget, size, color(s), terms, etc.)</font></label></td>
<td width="47%" align="left"><span id="sprytextarea1">
<textarea name="description" id="description" cols="27" rows="5"></textarea>
</span><font color="#FF0000">*</font></td>
</tr>
<tr>
<td align="left"><label for="first_name"><strong>Name:</strong></label>
<br>
<font color="#999999">(Title, First Name, Last Name)</font></p></td>
<td align="left">
<label for="title"></label>
<span id="spryselect3">
<select name="title" id="title">
<option value="">Title</option>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Miss">Miss</option>
</select></span>
<font color="#FF0000"><span id="sprytextfield1">
<input type="text" name="first_name" id="first_name" size="11" maxlength="40" />
</span>
<span id="sprytextfield2">
<input name="last_name" type="text" id="last_name" size="11" maxlength="40" />
</span>
<label for="first_name"></label>
*</font></p></td>
</tr>
<tr>
<td align="left"><strong>Please have responses to my request sent to:</strong></td>
<td align="left"> </td>
</tr>
<tr>
<td align="left"><strong>
<label for="best_contact">Best Way to Contact Me:</label>
</strong></td>
<td align="left"><span id="spryselect4">
<select name="best_contact" id="best_contact">
<option>No Preference</option>
<option>Phone</option>
<option>Email</option>
</select>
</span></td>
</tr>
<tr>
<td align="left"><label for="time"><strong>Best Time to Reach Me:<br />
</strong><font color="#999999">(Leave unchecked if you have "No Preference")</font>
</p>
</label></td>
<td align="left">
<span id="spryselect5">
<select name="from_time" id="from_time">
<option>No Preference</option>
<option>8:00am</option>
<option>9:00am</option>
<option>11:00am</option>
<option>12:00pm</option>
<option>1:00pm</option>
<option>2:00pm</option>
<option>3:00pm</option>
<option>4:00pm</option>
<option>5:00pm</option>
<option>6:00pm</option>
<option>7:00pm</option>
<option>8:00pm</option>
<option>9:00pm</option>
<option>10:00pm</option>
</select></span> -
<span id="spryselect6">
<select name="until_time" id="until_time">
<option>No Preference</option>
<option>9:00am</option>
<option>11:00am</option>
<option>12:00pm</option>
<option>1:00pm</option>
<option>2:00pm</option>
<option>3:00pm</option>
<option>4:00pm</option>
<option>5:00pm</option>
<option>6:00pm</option>
<option>7:00pm</option>
<option>8:00pm</option>
<option>9:00pm</option>
<option>10:00pm</option>
</select>
</span><br>
<label>
<input name="week_day_" type="checkbox" id="week_day_1" value="Mon."/>
M</label>
<label>
<input type="checkbox" name="week_day" value="Tue." id="week_day_2" />T</label>
<label>
<input type="checkbox" name="week_day" value="Wed." id="week_day_3" />W</label>
<label>
<input type="checkbox" name="week_day" value="Thu." id="week_day_4" />Th</label>
<label>
<input type="checkbox" name="week_day" value="Fri." id="week_day_5" />F</label>
<label>
<input type="checkbox" name="week_day" value="Sat." id="week_day_6" />S</label>
<label>
<input type="checkbox" name="week_day" value="Sun." id="week_day_7" />Su</label></span>
</td>
</tr>
<tr>
<td align="left"><strong>
<label for="phone">Primary Phone Number</label>
:<br />
</strong><font color="#999999">(3 digit Area Code followed by an 8 digit number)</font>
</p></td>
<td align="left"><span id="sprytextfield3">
<input name="primary_area_code" type="text" id="primary_area_code" size="1" maxlength="3" />
<span class="textfieldInvalidFormatMsg">Invalid format</span><span class="textfieldMinCharsMsg">Need 3 digit area code</span></span>
<span id="sprytextfield4">
<input name="primary_phone_number" type="text" id="primary_phone_number" size="6" maxlength="7" />
<span class="textfieldRequiredMsg">Required</span><span class="textfieldMinCharsMsg">Need 7 digit number</span><span class="textfieldInvalidFormatMsg">Invalid format</span></span> <font color="#FF0000">*</font></td>
</tr>
<tr>
<td align="left"><strong>
<label for="secondary_phone_number">Secondary Phone Number</label>
:<br />
</strong><font color="#999999">(3 digit Area Code followed by an 8 digit number)</font>
</p></td>
<td align="left"><span id="sprytextfield7">
<input name="secondary_area_code" type="text" id="secondary_area_code" size="1" maxlength="3" />
<span class="textfieldInvalidFormatMsg">Invalid format</span><span class="textfieldMinCharsMsg">Need 3 digit area code</span></span><span id="sprytextfield8">
<input name="secondary_phone_number" type="text" id="secondary_phone_number" size="6" maxlength="7" />
<span class="textfieldMinCharsMsg">Need 7 digit number</span><span class="textfieldInvalidFormatMsg">Invalid format</span></span></td>
</tr>
<td align="left"><strong>
<label for="email">Email Address:</label>
</strong></td>
<td align="left"><span id="sprytextfield5">
<input name="email_address" type="text" id="email_address" onblur="MM_validateForm('email','','RisEmail');return document.MM_returnValue" size="25" maxlength="100" />
<span class="textfieldInvalidFormatMsg">Invalid format</span><span class="textfieldRequiredMsg">Required</span></span><font color="#FF0000">*</font></td>
<tr>
<td align="right"><img src="captcha.php" id="img" border="0" title="Captcha">
</td>
<td align="left"><span id="sprytextfield6">
<input name="check" type="text" id="check" style="font-size:14px;font-family:'Trebuchet MS';font-weight:bold;color:#4D4D4E;border:#ccc 2px dotted;" size="1" maxlength="2"/>
<span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span><font color="#FF0000">*</font><br>
<i style="font-family:'trebuchet ms';font-size:12px;">Please enter security code</i> <a href="javascript:poptastic('http://www.metacalc.com/');">Click for Calculator</a>
</td>
</tr>
<tr>
<td align="right"><label for="submit"></label>
<input name="submit" type="submit" id="submit" onclick="MM_validateForm('first_name','','R','last_name','','R','email_address','','RisEmail','contact_area_code','','NisNum','evening_area_code','','NisNum','check','','RisNum','message','','R');return document.MM_returnValue" value="SEND REQUEST" /></td>
<td align="left"><label for="clear"></label>
<input type="reset" name="clear" id="clear" value="CLEAR FORM" /></td>
</tr>
</table>
</form>
<table width="100%" border="0" cellpadding="6">
<tr>
<td align="center"><font color="#FF0000">*</font> Are Required Fields</td>
</tr>
</table>
</center>
</div>
</div>

New Topic/Question
Reply



MultiQuote








|