Hi!
I have a contact form that won't...do anything!! I'm kinda new at this, although I've been succseful on MS SQL for YEARS...Can some one shed light on this? Thanx in advance!:
The HTML:
<!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=utf-8" />
<title>###### Contact Form</title>
<style>
*{ margin:0; padding:0;}
body{ font:100% normal Arial, Helvetica, sans-serif; background:#161712;}
form,input,select,textarea{margin:0; padding:0; color:#fff;}
div.box{
margin:0 auto;
width:500px;
background:#222;
position:relative;
top:50px;
border:1px solid #262626;
}
div.box h1{
color:#FFF5CC;
font-size:18px;
text-transform:uppercase;
padding:5px 0 5px 5px;
border-bottom:1px solid #161712;
border-top:1px solid #161712;
}
div.box label{
width:100%;
display: block;
background:#1C1C1C;
border-top:1px solid #262626;
border-bottom:1px solid #161712;
padding:10px 0 10px 0;
}
div.box label span{
display: block;
color:#bbb;
font-size:12px;
float:left;
width:100px;
text-align:right;
padding:5px 20px 0 0;
}
div.box .input_text{
padding:10px 10px;
width:200px;
background:#262626;
border-bottom: 1px double #171717;
border-top: 1px double #171717;
border-left:1px double #333;
border-right:1px double #333;
}
div.box .message{
padding:7px 7px;
width:350px;
background:#262626;
border-bottom: 1px double #171717;
border-top: 1px double #171717;
border-left:1px double #333;
border-right:1px double #333;
overflow:hidden;
height:150px;
}
div.box .button
{
margin:0 0 10px 0;
padding:4px 7px;
background:#CC0000;
border:0px;
position: relative;
top:10px;
left:382px;
width:100px;
border-bottom: 1px double #660000;
border-top: 1px double #660000;
border-left:1px double #FF0033;
border-right:1px double #FF0033;
}
</style>
</head>
<body>
<form action="http://www.######.com/cgi-bin/insert.php" method="post">
<div class="box">
<h1>Denver Mortgage Loan Contact Form</h1>
<label>
<span>First name *</span>
<input type="text" class="input_text" name="name_first" id="name_first"/>
</label>
<label>
<span>Middle Initial *</span>
<input type="text" class="input_text" name="name_mi" id="name_mi"/>
</label>
<label>
<span>Last name *</span>
<input type="text" class="input_text" name="name_last" id="name_last"/>
</label>
<label>
<span>Social Security Number *</span>
<input type="text" class="input_text" name="SSN" id="SSN"/>
</label>
<label>
<span>Street Number *</span>
<input type="text" class="input_text" name="AddressStreet" id="AddressStreet"/>
</label>
<label>
<span>City *</span>
<input type="text" class="input_text" name="Address_City" id="Address_City"/>
</label>
<label>
<span>Apt/Suite No. *</span>
<input type="text" class="input_text" name="Apt_ste" id="Apt_ste"/>
</label>
<label>
<span>Phone Number *</span>
<input type="text" class="input_text" name="phone" id="phone"/>
</label>
<label>
<span>Cell Phone Number *</span>
<input type="text" class="input_text" name="cphone" id="cphone"/>
</label>
<label>
<span>Email Address *</span>
<input type="text" class="input_text" name="email" id="email"/>
</label>
<label>
<span>Do You Own Or Rent (Please put Own or Rent) *</span>
<input type="text" class="input_text" name="own_rent" id="own_rent"/>
</label>
<label>
<span>Comments *</span>
<textarea class="message" name="comments" id="comments"></textarea>
<input type="submit" class="button" value="Submit Form" />
</label>
</div>
</form>
</body>
</html>
and the good ol php
<?php
$con = mysql_connect("#######","########","########");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$sql="INSERT INTO $####### (name_first, name_mi, name_last, AddressStreet, Address_City, PostalCode, Apt_Ste, phone, cphone, own_rent)
VALUES
('$_POST[name_first]','$_POST[ name_mi]','$_POST[name_last]','$_POST[AddressStreet]','$_POST[Address_City]','$_POST[PostalCode]','$_POST[Apt_Ste]','$_POST[phone]','$_POST[cphone]','$_POST[own_rent]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
So, here 'tis, and no worky worky. Of course, I am sure I got something erroneous, but for the life of...the script... I am clueless. Please help!!