Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello there,
I am trying to make a form that a person can fill out, and upon hitting send, the content of the form is emailed to me. I am new at this, and up to this point have only made simple forms that contain 4 variables. This one uses far more than that, and it utilizes a number of different input methods.
Here is my html...Code: Select all
<!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>Prestige Interactive - free quote form</title>
<style type="text/css">
<!--A:link {
text-decoration:none;
color: #FF0000;
} A:visited {
text-decoration:none;
color: #FF0000;
} A:active {
text-decoration:none;
color: #660000;
} A:hover {color:#909090}-->
</style>
<link href="../scripts/stylesheet_one.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<form action="../scripts/get_quote.php" method="post">
<table width="550" cellspacing="5">
<tr>
<td>
Contact Name</td>
</tr>
<tr>
<td >
<input name="name" type="text" size="50" maxlength="50" /></td>
</tr>
<tr>
<td>
Address</td>
</tr>
<tr>
<td>
<textarea name="address" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td>
Phone Number</td>
</tr>
<tr>
<td>
<input name="phone" type="text" size="15" maxlength="20" /></td>
</tr>
<tr>
<td>
Email</td>
</tr>
<tr>
<td>
<input name="email" type="text" size="40" maxlength="40" /></td>
</tr>
<tr>
<td>
Do you have a domain name? (eg. www.yourname.com)</td>
</tr>
<tr>
<td>
<input name="own_domain" type="radio" value="no" />no
<input name="own_domain" type="radio" value="yes" />yes</td>
</tr>
<tr>
<td>
Do you have a web service provider? (eg. a place where your site will be hosted)</td>
</tr>
<tr>
<td>
<input name="own_service_provider" type="radio" value="no" />no
<input name="own_service_provider" type="radio" value="yes" />yes</td>
</tr>
<tr>
<td>Do you need to have a business logo digitally designed?</td>
</tr>
<tr>
<td>
<input name="own_logo" type="radio" value="no" />
no
<input name="own_logo" type="radio" value="yes" />yes
</tr>
<tr>
<td>
Do you have images ready for use on your site?
</td>
</tr>
<tr>
<td>
<input name="own_images" type="radio" value="no" />no
<input name="own_images" type="radio" value="yes" />yes
</td>
</tr>
<tr>
<td>
Do you have your text ready?
</td>
</tr>
<tr>
<td>
<input name="own_text" type="radio" value="no" />
no
<input name="own_text" type="radio" value="yes" />yes
</td>
</tr>
<tr>
<td>
Would you like your site to use flash animation in its design? (see <a href="http://www.mcgibbysgolf.com" target="_blank"> McGibby's Golf</a> for an example)
</td>
</tr>
<tr>
<td>
<input name="need_flash" type="radio" value="no" />no
<input name="need_flash" type="radio" value="yes" />yes
</td>
</tr>
<tr>
<td>
List three sites that you'd like yours to be modelled after. (We want some ideas of what you like)
</td>
</tr>
<tr>
<td>
Site 1 - <input name="site_one" type="text" size="40" maxlength="40" />
<br />
Site 2 - <input name="site_two" type="text" size="40" maxlength="40" />
<br />
Site 3 - <input name="site_three" type="text" size="40" maxlength="40" />
</td>
</tr>
<tr>
<td>
Who are your major competitors? (Please provide their url's if applicable)
</td>
</tr>
<tr>
<td>
Site 1 - <input name="competitor_one" type="text" id="competitor_one" size="40" maxlength="40" />
<br />
Site 2 - <input name="competitor_two" type="text" size="40" maxlength="40" />
<br />
Site 3 - <input name="competitor_three" type="text" size="40" maxlength="40" />
</td>
</tr>
<tr>
<td>
How many pages will your completed site require? (Please include the home page)
</td>
</tr>
<tr>
<td>
<input name="pages" type="text" size="10" maxlength="10" /> pages
</td>
</tr>
<tr>
<td>
When would you like the site to be completed. (Please be aware that a short time frame can result in a higher cost to you)
</td>
</tr>
<tr>
<td>
<input name="completion" type="text" size="10" maxlength="10" /> days
<tr>
<td>
What is your project budget? (<span class="style1">Canadian funds</span>)</td>
</tr>
<tr>
<td>
<select name="budget" class="input">
<option>Please select an amount.</option>
<option value="budget_one">$0.00 - $400.00</option>
<option value="budget_two">$400.00 - $800.00</option>
<option value="budget_three">$800.00 - $1 200.00</option>
<option value="budget_four">$1200.00 - $1 600.00 </option>
<option value="budget_five">$1 600.00 - $2 000.00</option>
<option value="budget_six">$2 000.00 - $2 500.00</option>
<option value="budget_seven">$2 500.00 - $3 000.00 </option>
<option value="budget_eight">$3 000.00 - $4 000.00 </option>
<option value="budget_nine">$4 000.00 +</option>
</select>
</td>
</tr>
<tr>
<td>
How are you going to update the site?
</td>
</tr>
<tr>
<td>
<select name="budget" class="input">
<option>Please select a method for updating your site.</option>
<option value="update_one">We would like Prestige Interactive to update the site.</option>
<option value="update_two">We would like to update the site ourselves.</option>
</select>
</td>
</tr>
<tr>
<td>
Please provide us with any additional comments that you might have.
</td>
</tr>
<tr>
<td>
<textarea name="additional_comments" cols="50" rows="5"></textarea>
</td>
</tr>
<tr>
<td>
<input type="reset" value="Reset"> <input type="submit" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>Code: Select all
<?php
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
$errors = '';
if ($name == '' || $address == '' || $phone == '' || $email == '' $own_domain == '' $own_service_provider == '' $own_logo == '' $own_images == '' $own_text == '' $need_flash == '' $site_one == '' $site_two == '' $site_three == '' $competitor_one == '' $competitor_two == '' $competitor_three == '' $pages == '' $completion == '' $budget == '' $update == '' $additional_comments == '')
{
$errors .= '<li>You did not enter one or more of the required fields. Please go back and try again.</li>';
}
if ($errors != '')
{
echo "<html><body>The following errors occured while processing your form.<ul>\n$errors</ul></body></html>";
} else {
$message = '';
$message .= "Name= $name\n";
$message .= "Address= $address\n";
$message .= "Phone= $phone\n";
$message .= "Email= $email\n";
$message .= "Do you have your own domain= $own_domain\n";
$message .= "Do you have your own service provider= $own_service_provider\n";
$message .= "Do you have your own logo= $own_logo\n";
$message .= "Do you have your images prepared= $own_images\n";
$message .= "Do you have your text prepared= $own_text\n";
$message .= "Do you want to include flash= $need_flash\n";
$message .= "Sites we like= $site_one\n";
$message .= "Sites we like= $site_two\n";
$message .= "Sites we like=$site_three\n";
$message .= "Our competitors site= $competitor_one\n";
$message .= "Our competitors site= $competitor_two\n";
$message .= "Our competitors site= $competitor_three\n";
$message .= "How many pages will you need= $pages\n";
$message .= "When would you like the site completed= $completion\n";
$message .= "What is your budget= $budget\n";
$message .= "Who will update your site= $update\n";
$message .= "Additional comments= $additional_comments\n";
$message = stripslashes($message);
// mail the form submit
mail("gwhite@prestigeinteractive.com","Message from Prestige Interactive's Website requesting a pricing quote",$message, "From: <".$email.">");
header('Location: http://www.prestigeinteractive.com/mrwhite2/');
}
?>Thanks,
Greg
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]