php form parse error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I know i shouldn't work on php forms when i'm going on 30 hours of no sleep,
but i did anyway. I'm trying to get the below to work, and i keep getting a
parse error line 74, an unexpected
there is none, so i'm assuming it's on another line, i've checked around,
but don't see it. I'm probably missing something so simple that i'll call
myself dumb for a month, but that's later, as of now i'd appreciate any

// orderform.php script
// Created 20040730 by Dave M Mehler
// Purpose: collect order form information, process it, data verification,
// email designated users, and redirect visitor to a thank you page.
<title>streetfreakzperformance product order</title>
<body bgcolor="#ffffff" text="#000000" link="#cbda74" vlink="#808040"
$form = "
<form action=\"orderform.php\" method=\"post\">
<input type=\"hidden\" name=\"seenform\" value=\"y\">
<h1>Streetfreakzperformance Product Ordering Page</h1>
<p>Thank you for wishing to purchase products produced by
<b></b>! Please fill out the following form,
fields marked with a * (*) are required. You will recieve a confirmation
Your Name:<br />
<input type=\"text\" name=\"name\" size=\"20\" maxlength=\"20\"
value=\"\"><br />
Your Email:<br />
<input type=\"text\" name=\"email\" size=\"20\" maxlength=\"40\"
value=\"\"><br />
Your Comments:<br />
<textarea name=\"comments\" rows=\"3\" cols=\"30\"></textarea><br />
<input type=\"submit\" value=\"submit!\">
<input type=\"clear\" value=\"clear!\">
// If we haven't already seen the form ($seenform passed by hidden
// form value), show the form.
if ($seenform != "y") :
print "$form";
// The user has filled out the form. Now verify the information
else :
$error_flag = "n";
// ensure that the name variable is not empty
if ($name == "") :
print "<font color=\"red\">* You forgot to enter your name!</font>
 <br />";
$error_flag = "y";
// ensure that the email variable is not empty
if ($email == "") :
print "<font color=\"red\">* You forgot to enter your email!</font>
<br />";
$error_flag = "y";
else :
// convert all email alphabetical characters to lowercase
$email = strtolower(trim($email));
// ensure the email address is of valid syntax
if (! @eregi('^[0-9a-z]+'.
'([0-9a-z])$', $email)) :
print "<font color=\"red\">* You entered an invalid email
address!</font> <br />";
$error_flag = "y";
// If the $error_flag has been set, redisplay the form
if ($error_flag == "y") :
print "$form";
else :
// change $recipient to be the recipient of the form information
$recipient = "";
// email subject
$subject = "streetfreakzperformance product order request ($name)";
// extra email headers
$headers = "From: $email";
// send the email or produce an error
mail($recipient, $subject, $comments, $headers) or die("Could not send
// send the user an appropriate message
print "Thank you", $name, "for taking a moment to send us your comments!";

Re: php form parse error

dave wrote:
Quoted text here. Click to load it
Concatenation is made with . and not with ,

"La demande mondiale d’ordinateurs n’excédera pas cinq machines."
(Thomas Watson, Fondateur d'IBM, 1945)

Site Timeline