View Single Post
Old 09-17-2006, 06:52 AM   #1 (permalink)
sambkk
Junior Member
 
Join Date: 09-17-06
Posts: 17
iTrader: 0 / 0%
Latest Blog:
None

sambkk is liked by many
I am hoping for some help.About a php contact form.

Hi
I want to make a contact form but I am having some trouble.

I always use the same code for a simple form, but on a new site with a new host, it doesnt work.

I have no idea why. I turn CGI on already.

here is the code.
PHP file:
<?
$to = "xxx@xxxx.com";
$subject = "Email from website contact form";
$boundary = uniqid("");
$headers = "From: $from";
$body = "
Name :$user
Email :$emailaddress
Comment :$comments
";
if (mail($to, $subject, $body,$headers)) {
print( "Thank you for emailing us.Your file has been sent succesfully");
?>
<meta http-equiv=refresh content="1;URL=http://www.peacefulseasangha.com/sampleforliz/files/CUT H.html">
<?
}
else {
print( "Error: Unknown error ocurred. The message could not be sent. Please try again later.\n");
}
?>
and here is the code from the html file:
"...
Contact FORM
</div>
<div id="cu">
Please use the form below to send us email. Thank You.
<div id="flabels">
<br>Name:
<br>Email:
<br>Comments:
</div>
<div id="fitems">
<br>
<form name="form1" method="post" action="mail_t.php">
<input type="text" name="user" size="25">
<input type="text" name="emailaddress" size="25">
<textarea cols="10" rows="4" name="comments"></textarea>
<input type="submit" value="Send">
</form>
</div> ..."


I use the exact same code on many sites but this new site it just doesnt work with it. Does anyone have any idea what could be the reason?
Thanks.
Sami
sambkk is offline   Reply With Quote