mike475
04-02-2008, 04:59 PM
Hey guys,
Im trying to make a php contact form, but theres something wrong with it and I cant figure out what. If someone could point me in the right direction?
Many thanks.
send_contact.php
<?php
// Contact subject
$subject ="Save Reg Petiton Entry";
// Details
$message="$detail";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ='[email protected]';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>
the form
<body>
<form action="contactsuccess.php" method="post">
<div class="row"><label class="col1">Name: </label>
<span class="col2"><input name="Name" class="input" type="text" id="Name" size="50" tabindex="1" /></span>
</div>
<div class="row"><label class="col1">E-mail: </label>
<span class="col2"><input name="Email" class="input" type="text" id="Email" size="50" tabindex="2" /></span>
</div>
<div class="row"><label class="col1comment">Comment: </label>
<span class="col2comment"><textarea cols="20" class="textarea" rows="4" name="comment" id="comment" tabindex="4" ></textarea></span>
</div>
<div align="center" class="submit"><input type="image" src="images/b_send.gif" alt="send" width="52" height="19" border="0" />
</div>
</form>
</body>
Thanks again;
Heres a link to the page thing :: http://www.savereg.co.uk/petition.php
Im trying to make a php contact form, but theres something wrong with it and I cant figure out what. If someone could point me in the right direction?
Many thanks.
send_contact.php
<?php
// Contact subject
$subject ="Save Reg Petiton Entry";
// Details
$message="$detail";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ='[email protected]';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>
the form
<body>
<form action="contactsuccess.php" method="post">
<div class="row"><label class="col1">Name: </label>
<span class="col2"><input name="Name" class="input" type="text" id="Name" size="50" tabindex="1" /></span>
</div>
<div class="row"><label class="col1">E-mail: </label>
<span class="col2"><input name="Email" class="input" type="text" id="Email" size="50" tabindex="2" /></span>
</div>
<div class="row"><label class="col1comment">Comment: </label>
<span class="col2comment"><textarea cols="20" class="textarea" rows="4" name="comment" id="comment" tabindex="4" ></textarea></span>
</div>
<div align="center" class="submit"><input type="image" src="images/b_send.gif" alt="send" width="52" height="19" border="0" />
</div>
</form>
</body>
Thanks again;
Heres a link to the page thing :: http://www.savereg.co.uk/petition.php