Problem with Forms

jadiebrown

New Member
I posted on here recently to find out how to get a form to work. I had it working but now there is a problem with the fields themselves. I have four fields in the form - name, email, subject and message. In the email I receive from the website the name comes up as the subject, the subject and the message come up in the message body itself and the email is nowhere to be found. Obviously I have my correct email address in the PHP code

PHP Code:

<?php

$to = "[email protected]";
$name = $_POST ['name'];
$subject = $_POST ['subject'];
$message = $_POST ['message'];
$email = $_POST ['email'];


mail($to,$name,$subject,$message,$email);
echo "<b>Your mail has been sent.<br>
We will contact you shortly</b>";

?>

The form itself:

<form target="_blank" name="dn3contact" action="dn3sendmail.php"
method="post"> <label style="font-weight: bold; font-family: arial;">Your
Name: </label> <input style="border: 2px solid rgb(255, 0, 0);"
size="38" name="name" class="input-fields"><br>
<br>
<label style="font-weight: bold; font-family: arial;">Your
Email:</label> <input style="border: 2px solid rgb(255, 0, 0);"
size="38" name="email" class="input-fields"><br>
<br>
<label style="font-weight: bold; font-family: arial;">Subject: </label>&nbsp;
&nbsp; &nbsp; <input style="border: 2px solid rgb(255, 0, 0);"
size="38" name="subject" class="input-fields"> <br>
<br>
<label style="font-weight: bold; font-family: Arial;">Message: </label><br>
<textarea style="border: 2px solid rgb(255, 0, 0);" wrap="hard"
name="message" rows="5" cols="40" id="text-field"></textarea> <br>
<br>
<input name="token" value="&lt;?php echo $token ;?&gt;" type="hidden">
<input value="Submit" type="submit"> <input value="Reset"
type="reset"></form>


Any idea how I can get the name and email to come up in the FROM field;
The message in the message field and the subject obviously in the subject field?
 
Top