I have a form parsing variables to another page, but it’s not working as expected. The textarea in the form is not parsing variables typed in directly. Take a look at the code and help me figure this out. Thanks.
Form:
[code]<!doctype html>
Enter NamesNames:
2:
3:
Message: Hello . $name ..
This is just a test.
Thanks . $name . for taking the test.
PHP Code:
[php]<?php
if(isset($_POST[‘submit’])){
$name1=$_POST[‘name1’];
$name2=$_POST[‘name2’];
$name3=$_POST[‘name3’];
$message = $_POST[‘message’];
$recipients = array(
“$name1”,
“$name2”,
“$name3”,
);
foreach ($recipients as $name) {
//echo $name . “
”;
echo $message . "<p>";
}
echo “
CLICK HERE TO GO BACK”;
}
?>
[/php]
The output should display the variable $name typed in the textarea, but it does not. However, when I type in the message in the code directly it works. It never works as a form post from the textarea.
Please help.
Thanks.