jkswebsite
01-06-2007, 11:21 PM
Hi everyone, I'm new. Right now I am designing a site for someone, Qualityremodelinginc.net. Keep in mind it's under construction, but I need help on the Estimate page. He wants a form that people can fill out their information and check what services they need an estimate for, and click submit and there should be one new email in his box. I have read some tutorials, but it still doesnt work. This is what my form html looks like now, or you can preview it at Qualityremodelinginc.net/Estimates.html (http://www.Qualityremodelinginc.net/Estimates.html)
----------------------------------------
</body>
<li>
<p align="left"><font size="5"><font color="#663300">Phone:</font> (773)
509-0200</font>
<li>
<p align="left"><font size="5"><font color="#663300">Fax:</font> (773)
539-2177</font>
</ul>
<form method="POST" action="contact.php">
<p style="text-align: left"><b>First Name:
</b>
<input type="text" name="First">
<p style="text-align: left"><b>Last Name:
</b>
<input type="text" name="Last">
<p style="text-align: left"><b>Address:
</b>
<input type="text" name="Address" size="48"><b>
Unit #:</b><input type="text" name="Address0" size="21"><p style="text-align: left">
<b>City:</b>
<input type="text" name="City">
<p style="text-align: left"><b>State:
</b>
<input type="text" name="State">
<p style="text-align: left"><b>Zip:
</b>
<input type="text" name="Zip">
<p style="text-align: left"><b>Phone:
</b>
<input type="text" name="Telephone"> <b>Cell: </b>
<input type="text" name="Cell"> <b>Work:</b>
<input type="text" name="Work">
<p style="text-align: left"><b>Email:</b>
<input type="text" name="Email" size="48"><br>
<br>
<b>Services Requested:</b><form method="post" action="form.php">
<p style="text-align: left">
<input type="checkbox" name="services[]" value="Kitchen">Kitchen</input><br>
<input type="checkbox" name="services[]" value="Bathroom">Bathroom</input><br />
<input type="checkbox" name="services[]" value="Basement">Basement</input><br />
<input type="checkbox" name="services[]" value="Porch/Deck">Porch/Deck</input><br />
<input type="checkbox" name="services[]" value="Roofing">Roofing</input><br />
<input type="checkbox" name="services[]" value="Room Addition">Room Addition</input><br />
<input type="checkbox" name="services[]" value="Dormer/Attic">Dormer/Attic</input><br />
<input type="checkbox" name="services[]" value="Siding">Siding</input><br />
<input type="checkbox" name="services[]" value="Windows">Windows</input><br />
<input type="checkbox" name="services[]" value="Tuckpointing">Tuckpointing</input></p>
<p style="text-align: left">Other:
<input type="text" name="Other"><br>
<input type="submit" name="submit" value="Submit" />
</form>
<p>
----------------------------------------
And then I heard you need a contact.php page so I made one. I didn't really edit this while I edited the form, so it matches the original (which is totally different!) Well here is the Contact.php html
<?php // contact.php
if (isset($_POST['services']))
{
echo "You chose: " . join(', ', $_POST['services']) . ".\n";
}
echo "<br />\n";
echo "<a href=\"Error.html\">Choose again</a>\n";
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "Jkk088@sbcglobal.net";
$Subject = Trim(stripslashes($_POST['Subject']));
$First = Trim(stripslashes($_POST['First']));
$Last = Trim(stripslashes($_POST['Last']));
$Company = Trim(stripslashes($_POST['Company']));
$Address = Trim(stripslashes($_POST['Address']));
$Telephone = Trim(stripslashes($_POST['Telephone']));
$Mobile = Trim(stripslashes($_POST['Mobile']));
$Website = Trim(stripslashes($_POST['Website']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($First)=="") $validationOK=false;
if (Trim($Last)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "First: ";
$Body .= $First;
$Body .= "\n";
$Body .= "Last: ";
$Body .= $Last;
$Body .= "\n";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Telephone: ";
$Body .= $Telephone;
$Body .= "\n";
$Body .= "Mobile: ";
$Body .= $Mobile;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=Thanks.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=Error.html\">";
}
?>
----------------------------------------
Well I hope you all can help cause I am pretty clueless. Thank you SO much, and you all are very intelligent. Thanks again. My email is Jkk088@sbcglobal.net and my aim is Jkk088. So im me or email me. This form is very important to me and I know you guys can help.
//JK
----------------------------------------
</body>
<li>
<p align="left"><font size="5"><font color="#663300">Phone:</font> (773)
509-0200</font>
<li>
<p align="left"><font size="5"><font color="#663300">Fax:</font> (773)
539-2177</font>
</ul>
<form method="POST" action="contact.php">
<p style="text-align: left"><b>First Name:
</b>
<input type="text" name="First">
<p style="text-align: left"><b>Last Name:
</b>
<input type="text" name="Last">
<p style="text-align: left"><b>Address:
</b>
<input type="text" name="Address" size="48"><b>
Unit #:</b><input type="text" name="Address0" size="21"><p style="text-align: left">
<b>City:</b>
<input type="text" name="City">
<p style="text-align: left"><b>State:
</b>
<input type="text" name="State">
<p style="text-align: left"><b>Zip:
</b>
<input type="text" name="Zip">
<p style="text-align: left"><b>Phone:
</b>
<input type="text" name="Telephone"> <b>Cell: </b>
<input type="text" name="Cell"> <b>Work:</b>
<input type="text" name="Work">
<p style="text-align: left"><b>Email:</b>
<input type="text" name="Email" size="48"><br>
<br>
<b>Services Requested:</b><form method="post" action="form.php">
<p style="text-align: left">
<input type="checkbox" name="services[]" value="Kitchen">Kitchen</input><br>
<input type="checkbox" name="services[]" value="Bathroom">Bathroom</input><br />
<input type="checkbox" name="services[]" value="Basement">Basement</input><br />
<input type="checkbox" name="services[]" value="Porch/Deck">Porch/Deck</input><br />
<input type="checkbox" name="services[]" value="Roofing">Roofing</input><br />
<input type="checkbox" name="services[]" value="Room Addition">Room Addition</input><br />
<input type="checkbox" name="services[]" value="Dormer/Attic">Dormer/Attic</input><br />
<input type="checkbox" name="services[]" value="Siding">Siding</input><br />
<input type="checkbox" name="services[]" value="Windows">Windows</input><br />
<input type="checkbox" name="services[]" value="Tuckpointing">Tuckpointing</input></p>
<p style="text-align: left">Other:
<input type="text" name="Other"><br>
<input type="submit" name="submit" value="Submit" />
</form>
<p>
----------------------------------------
And then I heard you need a contact.php page so I made one. I didn't really edit this while I edited the form, so it matches the original (which is totally different!) Well here is the Contact.php html
<?php // contact.php
if (isset($_POST['services']))
{
echo "You chose: " . join(', ', $_POST['services']) . ".\n";
}
echo "<br />\n";
echo "<a href=\"Error.html\">Choose again</a>\n";
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "Jkk088@sbcglobal.net";
$Subject = Trim(stripslashes($_POST['Subject']));
$First = Trim(stripslashes($_POST['First']));
$Last = Trim(stripslashes($_POST['Last']));
$Company = Trim(stripslashes($_POST['Company']));
$Address = Trim(stripslashes($_POST['Address']));
$Telephone = Trim(stripslashes($_POST['Telephone']));
$Mobile = Trim(stripslashes($_POST['Mobile']));
$Website = Trim(stripslashes($_POST['Website']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($First)=="") $validationOK=false;
if (Trim($Last)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "First: ";
$Body .= $First;
$Body .= "\n";
$Body .= "Last: ";
$Body .= $Last;
$Body .= "\n";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Telephone: ";
$Body .= $Telephone;
$Body .= "\n";
$Body .= "Mobile: ";
$Body .= $Mobile;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=Thanks.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=Error.html\">";
}
?>
----------------------------------------
Well I hope you all can help cause I am pretty clueless. Thank you SO much, and you all are very intelligent. Thanks again. My email is Jkk088@sbcglobal.net and my aim is Jkk088. So im me or email me. This form is very important to me and I know you guys can help.
//JK