dquigley
New Member
- Messages
- 249
- Reaction score
- 0
- Points
- 0
So I bought a PHP book that is giving me lessons to do and the one I just did was a "All in one" script" that instead of having a front end and back end script it just has it all in one file. Anyways I typed it all up and I am getting a error on line 29.
Anyways here is the code
Line 29 is
Thanks for the help in advance, also please try to keep the help to error correction and not changing the script, this is just for learning, and Id like to do it BY THE BOOK so please, errors only.
Parse error: parse error in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allinone_form.php on line 29
Anyways here is the code
PHP:
<HTML>
<HEAD>
<TITLE>All-In-One</TITLE>
</HEAD>
<BODY>
<?
$form_block = "
<FORM METHOD=\"POST\" ACTION=\"$_SERVER[PHP_SELF]\">
<P><strong>Your Name:</strong><br>
<INPUT type=\"text\" NAME=\"sender_name\" SIZE=30></P>
<P><strong>Your E-Mail Address:</strong><br>
<INPUT type=\"text\" NAME=\"sender_email\" SIZE=30></P>
<P><strong>Message:</strong><br>
<TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual></TEXTAREA></P>
<INPUT type=\"hidden\" name=\"op\" value=\"ds\">
<P><INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Send This Form\"></P>
</FORM>";
if ($_POST[op] != "ds) {
// They need to see the form
echo "$form_block";
} else if ($_POST[op} =="ds") {
if ($_POST[sender_name] == "") {
$name_err = "font color=red>Please enter your name!</font><br>;
$send = "no";
if ($_POST[sender_email] == "") {
$email_err = "<font color=red>Please enter your e-mail address!</font><br>";
$send = "no";
}
if ($_POST[message] == "") {
$message_err = "<font color red>Please enter a message!</font><br>";
$send = "no";
}
if ($send != "no") {
// it's ok to send!
$to = "dquigley@dollarstoriches.com";
$subject = "All-In-One Website Feedback";
$mailheaders = "From: My Web Site <dquigley@dollarstoriches.com> \n";
$mailheaders .= "Reply-To: $_POST[sender_email]\n";
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Sender's Name: $_POST[sender_name]\n";
$msg .= "Sender's E-Mail: $_POST[sender_email]\n";
$msg .= "Message: $_POST[message]\n\n";
mail($to, $subject, $msg, $mailheaders);
echo "<P>Mail has been sent!</P>";
}
else if ($send == "no") {
echo "$name_err";
echo "$email_err";
echo "$message_err";
echo "$form_block";
}
}
?>
?>
</BODY>
</HTML>
Line 29 is
PHP:
echo "$form_block";
Thanks for the help in advance, also please try to keep the help to error correction and not changing the script, this is just for learning, and Id like to do it BY THE BOOK so please, errors only.