I am a php beginner. I am trying to post a form to a php script, but I am getting a parse error. Can someone please take a look at the code and tell me what's going on?
The parse error is on line 32 ("die()😉.
<!DOCTYPE html PUBLIC "-//w3c//dtd xhtml 1.0 Transitional//en"
"http://www.w3c.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3c.org/1999/xhtml">
<head>
<title>Form Validation</title>
</head>
<body style = "font-family: arial, sans-serif">
<?php
if (!ereg( "^\([0-9] {3}\)[0-9] {3}-[0-9] {4}$",
$phone ) )
{
print ( "<p><span style = \"color: red;
font-size: 2em\">
INVALID PHONE NUMBER </span><br />
A valid phone number must be in the form
<strong> (555)555-5555</strong><br />
<span style = \"color: blue\">
Click the Back button, enter a valid phone
number and resubmit.<br /><br />
Thank You. </span></p></body>' );
die();
}
?>
<p>Hi
<span style = "color: blue">
<strong>
<?php print ( "$fname" ); ?>
</strong>
</span>
Thank you for completing the survey.<br />
You have been added to the
<span style = "color: blue">
<strong>
<?php print ( "$book" ); ?>
</strong>
</span>
mailing list.
</p>
<strong> The following information has been saved in our database:</strong><br />
<table border = "0" cellpadding = "0" cellspacing = "10">
<tr>
<td bgcolor = "#ffffaa">Name</td>
<td bgcolor = "#ffffbb">Email</td>
<td bgcolor = "#ffffcc">Phone</td>
<td bgcolor = "#ffffdd">OS</td>
</tr>
<tr>
<?php
print ( "<td>$fname $lname</td>
<td>$email</td>
<td>$phone</td>
<td>$OS</td>" );
?>
</tr>
</table>
<br /><br /><br />
<div style = "font-size: 10pt; text-align: center">
This is only a sample form.
You have not been added to a mailing list.
</div>
</body>