Pooya Eslami wrote:
Hi, I'm new to php and this newsletter. I have a form on my webpage and a
php file to email it to me but the contents of the text area are not emailed
to me. Can anyone help me with this?

here is the code for my html and php files:

<html>
<head><title>Test</title></head>
<body>
<form action="textareamail.php" method="POST">
Comments: </br>
<textarea rows="10" cols="50" name="TextArea"></textarea>
</br>
<input type="reset" value="Clear">
<input type="submit" value="Submit">
</form>
</body>
</html>

<?php
if ($TextArea="") {
echo "You have to fill out the entire form,
go back and try again.";
} else {
$to = "[EMAIL PROTECTED]";
$from = "From-Test";
$subject = "Subject-Test";
$message = "$TextArea";

$message=$_POST[TextArea];


mail($to, $subject, $message,"From: $from");
echo "Thankyou";
}
?>

A better way (imo) is to do it as javascript and pop up a window with the message. No server-side processing is then needed until a successful message is submitted.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to