<?php
print "Survey";
if (!isset($_POST['submit'])) {
?>
<FORM METHOD="POST" action="<?= $PHP_SELF; ?>">
Name: <INPUT TYPE=TEXT NAME="name"><BR>
E-Mail <INPUT TYPE=TEXT NAME="email">
<INPUT TYPE="SUBMIT" name="submit" VALUE="Submit">
<?
} else {
print "Your name is " . $_POST['name'] . "and yor e-mail is " . $_POST['email'];
}
?>
You don't have to weave in and out, but the way you had it, you just had html inside php, and html tags are not php functions. What you'd need to do if you didn't want to weave out of php is echo out the html, making sure to escape all quotations.
echo "<form method=\"post\" action=\"" . $PHP_SELF . "\">";
There's room for a lot of parse errors; it may be easier for you to just weave in and out for now.
Cgraz