i am a complete rookie to php and to this site. i am attempting to make a contact form for a realtor (probably a little more involved than i should be getting into), but am unsure if it is coded correctly. i was hoping someone could take a look at the form as well as the php file and let me know if it will work properly. also you will see in the php that i was unsure (unsure about it all actually) about the checkbox.
any assistance is appreciated
jasoncstyle
below is the form
<form name="contact" METHOD="POST" ACTION="contact.php" onSubmit="return check();">
<p> Name:
<input name="name" type="text" id="name">
</p>
<p> Email:
<input type="text" name="email">
</p>
<p>Address:
<input name="address" type="text" id="address">
</p>
<p>Phone (xxx-xxx-xxxx):
<input name="phone" type="text" id="phone">
</p>
<p>Fax (xxx-xxx-xxxx):
<input name="fax" type="text" id="fax">
</p>
<p>I want to:
<input type="radio" name="buyselllease" value="buy">
buy
<input type="radio" name="inquirybuyselllease" value="sell">
Sell
<input type="radio" name="inquirybuyselllease" value="lease">
Lease</p>
<p>the following type of property: <br>
<select name="propertytype[]" size="3" multiple id="propertytype[]">
<option value="residential" selected>residential</option>
<option value="commercial">commercial</option>
<option value="land">land</option>
</select>
</p>
<p>I am most interested in these Myrtle Beach/Grand Strand areas (hold 'control' key to select more than one):<br>
<select name="area[]" size="17" multiple id="area[]">
<option value="Carolina Forest" selected="selected">Carolina Forest</option>
<option value="Conway">Conway</option>
<option value="Forestbook">Forestbrook</option>
<option value="Garden City">Garden City</option>
<option value="Litchfield">Litchfield</option>
<option value="Little River">Little River</option>
<option value="Murrells Inlet">Murrells Inlet</option>
<option value="Myrtle Beach">Myrtle Beach</option>
<option value="North Myrtle Beach">North Myrtle Beach</option>
<option value="Pawleys Island">Pawleys Island</option>
<option value="Socastee">Socastee</option>
<option value="Surfside">Surfside</option>
<option value="Calabash, NC">Calabash, NC</option>
<option value="Ocean Isle">Ocean Isle</option>
<option value="Sunset Beach, NC">Sunset Beach, NC</option>
<option value="Other">Other</option>
<option value="Not Sure">Not Sure</option>
</select>
</p>
<p><b>Check all boxes that apply</b><br>
<input type="checkbox" name="PR1" value="I want to buy a single family home" tabindex="1"> I want to buy a single family home<br>
<input type="checkbox" name="PR2" value="I want to buy a condo/townhouse" tabindex="2"> I want to buy a condo/townhouse<br>
<input type="checkbox" name="PR3" value="I want to buy investment property" tabindex="3"> I want to buy investment property<br>
<input type="checkbox" name="PR4" value="I want to buy property to rehab" tabindex="4"> I want to buy property to rehab<br>
<input type="checkbox" name="PR5" value="I want to buy land and/or development property" tabindex="5"> I want to buy land and/or development property<br>
<input type="checkbox" name="PR6" value="I want to sell a single family home" tabindex="6"> I want to sell a single family home<br>
<input type="checkbox" name="PR7" value="I want to sell a condo/townhouse" tabindex="7"> I want to sell a condo/townhouse<br>
<input type="checkbox" name="PR8" value="I want to sell investment property" tabindex="8"> I want to sell investment property<br>
<input type="checkbox" name="PR9" value="I want to sell property to rehab" tabindex="9"> I want to sell property to rehab<br>
<input type="checkbox" name="PR10" value="I want to sell land and/or development property" tabindex="10"> I want to sell land and/or development property
</p>
<p>Please give me any additional information that you have regarding your real estate needs. It will help me respond more accurately to your request:
<br>
<br>
<textarea name="info" COLS=40 ROWS=5 id="info"></textarea>
</p>
<p><select name="find" size="1" id="find">
<option selected>How did you find this site?</option>
<option value="Repeat visit">Repeat visit</option>
<option value="Yard sign">Yard sign</option>
<option value="From an agent">From an agent</option>
<option value="Search engine (Google, Yahoo, etc)">Search engine (Google, Yahoo, etc)</option>
<option value="Postcard / Printed flyer">Postcard / Printed flyer</option>
<option value="Newspaper/Magazine Ad">Newspaper/Magazine Ad</option>
<option value="Word of mouth">Word of mouth</option>
</select></p>
<p>
<input name="submit" type="image" title="Send" src="../images/index/send_but2.jpg" alt="Send" align="bottom" />
</p>
</form>
and here is the php
<?php
if(isset($_POST['submit'])) {
$to = "paige@paigebird.com";
$subject = "Contact Me website email";
$name = $POST['name'];
$email = $POST['email'];
$phone = $POST['phone'];
$fax = $POST['fax'];
$buyselllease = $POST['buyselllease'];
$propertytype = $POST['propertytype'];
$area = $POST['area'];
//missing checkbox...not sure what to do here
$info = $POST['info'];
$find = $_POST['find'];
$body = "From: $name\n E-Mail: $email\n Phone: $phone\n Fax: $fax\n BuySellLease: $buyselllease\n PropertyType: $propertytype\n Area: $area\n Info: $info\n Found: $find\n";
$headers2 = "From: noreply@paigebird.com";
$subject2 = "Thank you for contacting Paige Bird";
$autoreply = "Thank you for contacting me. I will get back to you as soon as possible, usually within 48 hours.";
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
if($from == '') {print "You have not entered an email, please go back and try again";}
else {
echo "Your information has been submitted to $to!";
$send = mail($to, $subject, $body);
$send2 = mail($email, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.YourDomain.com/thankyou.html" );}
else
{print "We encountered an error sending your mail, please notify webmaster@YourCompany.com"; }
}
}
?>