Page 1 of 1
parse error! need help!
Posted: Thu Jun 16, 2005 7:29 pm
by word32
i have this code
click here to veiw the code
whenever i try it (go
here to try it) it says, "Parse error: parse error in /home/i/ipodize.siteburg.com/WWW/tellafriend.php on line 57"
what is wrong?
thanks in advance,
-word32
Posted: Thu Jun 16, 2005 7:33 pm
by hawleyjr
Remote host is forbidden. Please post your code.
Code: Select all
Forbidden
You do not have permission to access http://ipodize.biz.ly/tellafriend.txt
Posted: Fri Jun 17, 2005 2:16 pm
by word32
sorry, here's the code:
Code: Select all
<?PHP
# This section removes any nasty tags that the
# user may have entered in the form fields
strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);
# This section sends you a notification email when
# the form is used
// Your email address (for copies to be sent to you)
$emailto = "smarterchildbud@lycos.co.uk";
// Your email subject text
$esubject = "a page has been sent";
// The email text for copies sent to you
$emailtext = "
".$name." has used the tell-a-friend form. Their email address is ".$email."
The people they have recommended are:
".$friendmail1."
".$friendmail2."
".$friendmail3."
";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");
## This section sends to the recipients
// Target page after successful submission
$thankyoupage = "thankyou.htm";
// Change the subject text below to suit
$tsubject = "A great site";
// Change the text below for the email
$ttext = "
Hi,
A friend or colleague of yours, ".$name.", whose email address is ".$email." thought you may like to order an ipodized picture off our site.<b>PLEASE NOTE TO ONLY USE THIS E-MAIL TO ORDER YOUR PICTURE!</b> if you don't use this form, ".$name." will not be credited.
<html>
<font face=" trebuchet ms"><font size="5"><font color="#0099ff">iPodize</font> me!</font></font><br>
Do you want to have your picture ipodized? It's cool and only costs $6.00.
</font></font><form action="/cgi-bin/cgiemail" method="get">
<font face=" trebuchet ms"><font size="3"><input name="cgiemail_html" value="/ipodmyphoto2.html" type="hidden">
<input name="cgiemail_invalid" value="You entered an invalid email address. Press back to Re-enter" type="hidden">
<font face=" trebuchet ms"><font size="5"><font color="#0099ff">Order</font> your photo here!</font>
</font></font></font><p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font color="#0099ff"><b>First </b></font>Name: _ _ _ _ _ <font size="3"><font color="#0099ff"><b>last </b></font>Name:<br><input name="first_name" value="" size="15" maxlength="20" type="text"> <input name="last_name" value="" size="15" maxlength="20" type="text"></font></font></font></font></font></p>
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><b>Address</b></font>:_ _ _ _ _ _ _ _ _ _ <font size="3"><font color="#0099ff"><b>e-</b></font>mail:<br><input name="Address" value="" size="25" maxlength="20" type="text"> <input name="email" value="me@myplace.something" size="25" maxlength="20" type="text"></font></font></font></font></font></font></font></p>
<input name="".$email." value="" size="15" maxlength="20" type="hidden">
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><b><font color="#0099ff">Background</font></b> Color
</font></font></font></font></font></font></font></p><p><select name="color"><option value="Blue">Blue</option><option value="orange">orange</option><option value="purple">purple</option><option value="green">green</option><option value="pink">pink</option></select></p>
<p><select name="has_ipod"><option value="yes">YES - Draw with them an iPod</option><option value="no">NO - DON'T draw them wearing an iPod</option></select></p>
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><b><font color="#0099ff">Picture:</font></b><font color="#0099ff"> <input name="image" type="file"></font></font></font></font></font></font></font></font></p>
<font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><input name="action" value="submit" type="hidden">
<input name="submit" value="Order" type="submit"><input value="Reset Feilds" type="reset">
<font size="2"></font></font></font></font></font></font></font></font></font><p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><font size="2">"iPod" is the property of Apple Computer. iPodize is not affiliated with Apple Computer in any way, except that we love iPods.</font></font></font></font></font></font></font></font></font></p><table style="clear: both;" align="center">
</html>
";
# This sends the email to the addresses entered
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM: $email");
# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>
thanks in advance,
-word32
Posted: Fri Jun 17, 2005 2:50 pm
by John Cartwright
change
to single quotes.
and read
http://ca3.php.net/types.string
Posted: Fri Jun 17, 2005 3:10 pm
by dnathe4th
alternately you can do this:
Code: Select all
echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon. no extra whitespace!
END;
that allows you to not worry about any quote usage inside the echo area. Just make sure you dont use the terminator (END in this case) within the block
Posted: Fri Jun 17, 2005 4:58 pm
by word32
where would i put that?
oh, and i did what Jcart said and now it says, error on line 47
thanks in advance,
-word32
Posted: Fri Jun 17, 2005 5:05 pm
by Chris Corbyn
word32 wrote:where would i put that?
Code: Select all
$ttext = <<<EOD
Hi,
A friend or colleague of yours, {$name}, whose email address is {$email} thought you may like to order an ipodized picture off our site.<b>PLEASE NOTE TO ONLY USE THIS E-MAIL TO ORDER YOUR PICTURE!</b> if you don't use this form, {$name} will not be credited.
<html>
<font face=" trebuchet ms"><font size="5"><font color="#0099ff">iPodize</font> me!</font></font><br>
Do you want to have your picture ipodized? It's cool and only costs $6.00.
</font></font><form action="/cgi-bin/cgiemail" method="get">
<font face=" trebuchet ms"><font size="3"><input name="cgiemail_html" value="/ipodmyphoto2.html" type="hidden">
<input name="cgiemail_invalid" value="You entered an invalid email address. Press back to Re-enter" type="hidden">
<font face=" trebuchet ms"><font size="5"><font color="#0099ff">Order</font> your photo here!</font>
</font></font></font><p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font color="#0099ff"><b>First </b></font>Name: _ _ _ _ _ <font size="3"><font color="#0099ff"><b>last </b></font>Name:<br><input name="first_name" value="" size="15" maxlength="20" type="text"> <input name="last_name" value="" size="15" maxlength="20" type="text"></font></font></font></font></font></p>
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><b>Address</b></font>:_ _ _ _ _ _ _ _ _ _ <font size="3"><font color="#0099ff"><b>e-</b></font>mail:<br><input name="Address" value="" size="25" maxlength="20" type="text"> <input name="email" value="me@myplace.something" size="25" maxlength="20" type="text"></font></font></font></font></font></font></font></p>
<input name="{$email}" value="" size="15" maxlength="20" type="hidden">
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><b><font color="#0099ff">Background</font></b> Color
</font></font></font></font></font></font></font></p><p><select name="color"><option value="Blue">Blue</option><option value="orange">orange</option><option value="purple">purple</option><option value="green">green</option><option value="pink">pink</option></select></p>
<p><select name="has_ipod"><option value="yes">YES - Draw with them an iPod</option><option value="no">NO - DON'T draw them wearing an iPod</option></select></p>
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><b><font color="#0099ff">Picture:</font></b><font color="#0099ff"> <input name="image" type="file"></font></font></font></font></font></font></font></font></p>
<font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><input name="action" value="submit" type="hidden">
<input name="submit" value="Order" type="submit"><input value="Reset Feilds" type="reset">
<font size="2"></font></font></font></font></font></font></font></font></font><p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><font size="2">"iPod" is the property of Apple Computer. iPodize is not affiliated with Apple Computer in any way, except that we love iPods.</font></font></font></font></font></font></font></font></font></p><table style="clear: both;" align="center">
</html>
EOD;
Note: You needed to escape your " " " double quoes too in your example.
EDIT | Also note that in HTML you should refer to things such as "$" as their entity equivalents (i.e. $ or &#xxx;)
Posted: Fri Jun 17, 2005 5:23 pm
by word32
ok, now it says there is an error on line 78
oh, and here is the updated (so far) code:
Code: Select all
<?PHP
# This section removes any nasty tags that the
# user may have entered in the form fields
strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);
# This section sends you a notification email when
# the form is used
// Your email address (for copies to be sent to you)
$emailto = "smarterchildbud@lycos.co.uk";
// Your email subject text
$esubject = "a page has been sent";
// The email text for copies sent to you
$emailtext = "
".$name." has used the tell-a-friend form. Their email address is ".$email."
The people they have recommended are:
".$friendmail1."
".$friendmail2."
".$friendmail3."
";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");
## This section sends to the recipients
// Target page after successful submission
$thankyoupage = "thankyou.htm";
// Change the subject text below to suit
$tsubject = "A great site";
// Change the text below for the email
$ttext = <<<EOD
Hi,
A friend or colleague of yours, {$name}, whose email address is {$email} thought you may like to order an ipodized picture off our site.<b>PLEASE NOTE TO ONLY USE THIS E-MAIL TO ORDER YOUR PICTURE!</b> if you don't use this form, {$name} will not be credited.
<html>
<font face=" trebuchet ms"><font size="5"><font color="#0099ff">iPodize</font> me!</font></font><br>
Do you want to have your picture ipodized? It's cool and only costs $6.00.
</font></font><form action="/cgi-bin/cgiemail" method="get">
<font face=" trebuchet ms"><font size="3"><input name="cgiemail_html" value="/ipodmyphoto2.html" type="hidden">
<input name="cgiemail_invalid" value="You entered an invalid email address. Press back to Re-enter" type="hidden">
<font face=" trebuchet ms"><font size="5"><font color="#0099ff">Order</font> your photo here!</font>
</font></font></font><p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font color="#0099ff"><b>First </b></font>Name: _ _ _ _ _ <font size="3"><font color="#0099ff"><b>last </b></font>Name:<br><input name="first_name" value="" size="15" maxlength="20" type="text"> <input name="last_name" value="" size="15" maxlength="20" type="text"></font></font></font></font></font></p>
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><b>Address</b></font>:_ _ _ _ _ _ _ _ _ _ <font size="3"><font color="#0099ff"><b>e-</b></font>mail:<br><input name="Address" value="" size="25" maxlength="20" type="text"> <input name="email" value="me@myplace.something" size="25" maxlength="20" type="text"></font></font></font></font></font></font></font></p>
<input name="{$email}" value="" size="15" maxlength="20" type="hidden">
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><b><font color="#0099ff">Background</font></b> Color
</font></font></font></font></font></font></font></p><p><select name="color"><option value="Blue">Blue</option><option value="orange">orange</option><option value="purple">purple</option><option value="green">green</option><option value="pink">pink</option></select></p>
<p><select name="has_ipod"><option value="yes">YES - Draw with them an iPod</option><option value="no">NO - DON'T draw them wearing an iPod</option></select></p>
<p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><b><font color="#0099ff">Picture:</font></b><font color="#0099ff"> <input name="image" type="file"></font></font></font></font></font></font></font></font></p>
<font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><input name="action" value="submit" type="hidden">
<input name="submit" value="Order" type="submit"><input value="Reset Feilds" type="reset">
<font size="2"></font></font></font></font></font></font></font></font></font><p><font face=" trebuchet ms"><font size="3"><font face=" trebuchet ms"><font size="3"><font size="3"><font size="3"><font size="3"><font color="#0099ff"><font size="2">"iPod" is the property of Apple Computer. iPodize is not affiliated with Apple Computer in any way, except that we love iPods.</font></font></font></font></font></font></font></font></font></p><table style="clear: both;" align="center">
</html>
EOD;
# This sends the email to the addresses entered
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM: $email");
# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>
thanks in advance,
-Word32
Posted: Fri Jun 17, 2005 5:26 pm
by Chris Corbyn
That last
EOD;
On it's own should be right to the left hand margin.... it's not your fault nor is it mine... something's gone wrong with the way the code is displaying on the forum... apologies.
Posted: Fri Jun 17, 2005 8:30 pm
by dnathe4th
the EOD; has to be on its own line without any whitespace at all