I am trying to do use number of PHP email forms and in each one none of my variables (the form elements) show up in the messages. I turned on sendmail using the directions at
http://www.macdevcenter.com/lpt/a/2692 and it now sends mail (which is definite progress) but it won't send variables in the email messages. This is a simple form I am using that I found online (I filled out my email address). When it sends all it sends it the email contents without any of the variables.
php page:
<?
//Declare the variables
$recipient = "myemailaddress@email.com";
$subject = "User Feedback";
$message = "Hi there! The user $name just filled in the contact for. The return email is $email and they said $comments";
$subject=$_POST['subject'];
//Contents of form
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments'];
//mail() function sends the mail
mail($recipient,$subject,$message,$email);
//This line sends to thankyou page when finished
header("Location:
http://resma.net/php/contact/sent.php");
?>
html page:
<html>
<head>
<title>Form</title>
</head>
<body>
<form action=form.php method=post>
<br>
Your Name: <input type=text name=name>
<br>
E-mail: <input type=text name=email>
<br>
Subject: <input type=text name=subject>
Comments<br>
<textarea name=comments></textarea>
<br>
<input type=submit value=Submit>
</body>
</html>
I have this problem with all form emailers that I have tried, including one generated from inPHormer, a cool program I found on versiontracker to generate PHP email forms (you have to go to the site to download the free version).
Does anyone know what's wrong? This is really frustrating me. Thanks.
EDIT: how do i get code to display properly in vBulletin? the code] tag made safari actually interpret and render the code.