I want to add a form in my web site.....
i found the code online...i modificate it as long as i could....but still it doesnt work well...
so please if someone knows and can help me i will appreciate it...
thank you!
thats my contact_thanks.php form code::::::
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body><?php
if (($Name == "") || ($surname == "") || ($company == "") || ($address == "") || ($address2== "") || ($city == "") || ($province == "") || ($postalcode == "") || ($country == "") || ($phone == "") || ($email == "") || ($username == "")|| ($password == "") || ($verpassword == "") || ($comments == ""))
{
echo "<form name=form method=post action=contact_thanks.php>";
echo "<p class=bodymd>All three fields of this form are required.</p>
echo "<p class=bodymd>I really dont think that is too much to ask</p>";
echo "<p class=bodymd>Fill in the ones you missed, they are listed below</p>";
}
if ($Name == "")
{
echo "<p class=bodymd>Name<br><input type=text name=Name></p>";
}
else
{
echo "<input type=hidden name=Name value=$Name>";
}
if ($surname == "")
{
echo "<p class=bodymd>Surname<br><input type=text name=surname></p>";
}
else
{
echo "<input type=hidden name=surname value=$surname>";
}
if ($company == "")
{
echo "<p class=bodymd>Company<br><input type=text name=company></p>";
}
else
{
echo "<input type=hidden name=company value=$company>";
}
if ($address == "")
{
echo "<p class=bodymd>Address<br><input type=text name=address></p>";
}
else
{
echo "<input type=hidden name=address value=$address>";
}
if ($address2 == "")
{
echo "<p class=bodymd>Address 2<br><input type=text name=address2></p>";
}
else
{
echo "<input type=hidden name=address2 value=$address2>";
}
if ($city == "")
{
echo "<p class=bodymd>City<br><input type=text name=city></p>";
}
else
{
echo "<input type=hidden name=city value=$city>";
}
if ($province == "")
{
echo "<p class=bodymd>Province<br><input type=text name=province></p>";
}
else
{
echo "<input type=hidden name=province value=$province>";
}
if ($postalcode == "")
{
echo "<p class=bodymd>Postal Code<br><input type=text name=postalcode></p>";
}
else
{
echo "<input type=hidden name=postalcode value=$postalcode>";
}
if ($country == "")
{
echo "<p class=bodymd>Country<br><input type=text name=country></p>";
}
else
{
echo "<input type=hidden name=country value=$country>";
}
if ($phone == "")
{
echo "<p class=bodymd>Phone Number<br><input type=text name=phone></p>";
}
else
{
echo "<input type=hidden name=phone value=$phone>";
}
if ($email == "")
{
echo "<p class=bodymd>Your Email<br><input type=text name=email></p>";
}
else
{
echo "<input type=hidden name=email value=$email>";
}
if ($username == "")
{
echo "<p class=bodymd>Username<br><input type=text name=username></p>";
}
else
{
echo "<input type=hidden name=username value=$username>";
}
if ($password == "")
{
echo "<p class=bodymd>Password<br><input type=text name=password></p>";
}
else
{
echo "<input type=hidden name=password value=$password>";
}
if ($verpassword == "")
{
echo "<p class=bodymd>Verify password<br><input type=text name=verpassword></p>";
}
else
{
echo "<input type=hidden name=verpassword value=$verpassword>";
}
if ($comments == "")
{
echo "<p class=bodymd>Write Us Your Issue<br> <textarea name=comments rows=5 cols=40></textarea></p>";
}
else
{
echo "<input type=hidden name=comments value=$comments>";
}
if (($Name == "") || ($surname == "") || ($company == "") || ($address == "") || ($address2== "") || ($city == "") || ($province == "") || ($postalcode == "") || ($country == "") || ($phone == "") || ($email == "") || ($username == "")|| ($password == "") || ($verpassword == "") || ($comments == ""))
{
echo "<input type=submit name=Submit value=Submit>";
echo "<input type=reset name=Reset value=Clear Form>";
echo "</form>";
}
else
{
$message = "Name: $Name\nSurname: $surname\nCompany: $company\nAddress: $address\nAddress2: $address2\nCity: $city\nProvince: $province\nPostal Code: $postalcode\nCountry: $country\nPhone: $phone\nEmail: $email\nUserName: $username\nPassword: $password\nVerify Password: $verpassword\nComments: $comments\n";
$extra = "From: $Name\r\nReply-To: $Email\r\n";
mail ("emcs63@msn.com", "Website Email", $message, $extra);
echo "<p class=bodymd>Thanks for your inguiry, $Name.</p>";
echo "<p class=bodymd>A response will be sent to $Email as soon as possible.</p>";
}
?>
</body>
</html>
and my contact_thanks.html form code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body><form
action="http://www.MYWEBSITE.com/contact_thanks.php" method="post" enctype="text/html" name="form">
<p class="bodymd"> Name
<input name="Name" type="text" size="50">
</p>
<p class="bodymd"> Surname
<input name="surname" type="text" id="surname" size="50">
</p>
<p class="bodymd">Company
<input name="company" type="text" id="company" size="50">
</p>
<p class="bodymd">Address
<input name="address" type="text" id="address" size="50">
</p>
<p class="bodymd">Address 2
<input name="address2" type="text" id="address2" size="50">
</p>
<p class="bodymd"> City
<input name="city" type="text" id="city" size="50">
</p>
<p class="bodymd">Province
<input name="province" type="text" id="province" size="50">
</p>
<p class="bodymd">Postal Code
<input name="postalcode" type="text" id="postalcode" size="50">
</p>
<p class="bodymd">Country
<input name="country" type="text" id="country" size="50">
</p>
<p class="bodymd">Phone Number
<input name="phone" type="text" id="phone" size="50">
</p>
<p class="bodymd">Your Email
<input name="email" type="text" id="email" size="50">
</p>
<p class="bodymd">Username
<input name="username" type="text" id="username" size="50" maxlength="10">
</p>
<p class="bodymd">Password
<input name="password" type="password" id="password" size="50" maxlength="10">
</p>
<p class="bodymd">Verify Password
<input name="verpassword" type="password" id="verpassword" size="50" maxlength="10">
</p>
<p class="bodymd">Write Us Your Issue: </p>
<p class="bodymd">
<textarea name="comments" cols="50" rows="10" id="comments"></textarea>
</p>
<p class="bodymd"> </p>
<p class="bodymd"><br>
</p>
<p class="bodymd">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Clear Form">
</p>
</form>
</body>
</html>
I need some help please!!!!