Hi,
I'm being plagued by parsing error. My ISP has PHP version '4.0.3pl1' but they don't support PHP.
I have spent 9 hours trying to get a form where the user enters their email address and that address is recorded in a database - but I can't seem to setup an 'if-else' statement without getting errors. I have pages and pages of printouts of code-examples, and I can't seem to get any of them to work. I don't get errors with the individual code blocks, but I do when they are contained within the if-else structure.
The following code gives a parse error on the line beginning with 'form'.
<?php
if ($submit && $email != "") {
$db = mysql_connect("localhost","***","****");
mysql_select_db("bioscree",$db);
$sql = mysql_query("INSERT into mailing_list (email) VALUES ($email);
$result = mysql_query($sql);
} else {
print <<< mylabel
<form method="post" action="announcements.php4">
If you would like to be notified of important announcements,<br>
and receive our regular newsletters enter you email address below<br>
<input type="text" name="email">
<input type=submit name="submit" value="subscribe">
</form>
mylabel;
}
?>
Thanks in advance for any thoughts,
Paul Leverenz