Jump to content

email contact form problem


silverglade

Recommended Posts

hi, when i enter in "myname" for name and "subject" for subject. i get this result in my email's inbox.  "

 

 

subject‏

From: myname subject

 

Sent: Mon 7/05/10 11:37 AM

To: [email protected]

 

message

 

i want the form to show my name, and the subject to show the subject, and my email address to show up too. and its not . any help making this work is greatly appreciated. thanks .derek 

 

here is the code for the form.

 

<table
width="400" border="0" align="center" cellpadding="3"
cellspacing="1">

<tr>
<td>
<strong>Derek's first magical contact form</strong>
</td>
</tr>
</table>
<table width="400" border="0" align="center"
cellpadding="0" cellspacing="1">
<tr>
<td>
<form name="dereksform" method="post"
action="send_contact.php">
<table width="100%" border="0" cellspacing="1"
cellpadding="3">
<tr>
<td width="16%">Subject</td>
<td width="2%">:</td>
<td width="82%"><input name="subject" type=text" id="subject" size="50"></td>
</tr>
<tr>
<td>Detail</td>
<td>:</td>
<td><textarea name="detail" cols="50" rows="4"
id="detail"></textarea></td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input name="customer_mail" type="text" id="customer_mail" size="50"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>

 

and here is the code to submit the form

<?php
//contact subject
$subject=$_POST["subject"];
//details
$message=$_POST["detail"];
//mail of sender
$mail_from=$_POST["customer_mail"];
//from
$name=$_POST["name"];
$header=$mail_from;
//enter your email adress
$to='[email protected]';
$send_contact=mail($to,$subject,$message,$header);
//check if message sent to your email
echo "we've received your information<br />";
if($send_contact){
echo "You just sent a magical email to derek!";
}
else{
echo "crap it didnt work.";
}
?>

 

Link to comment
https://forums.phpfreaks.com/topic/206780-email-contact-form-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.