parse error! need help!
Moderator: General Moderators
parse error! need help!
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
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
Remote host is forbidden. Please post your code.
Code: Select all
Forbidden
You do not have permission to access http://ipodize.biz.ly/tellafriend.txtsorry, here's the code:
thanks in advance,
-word32
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;
?>-word32
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
change
to single quotes.
and read http://ca3.php.net/types.string
Code: Select all
$ttext = " ... ";Code: Select all
$ttext = ' ... ';alternately you can do this:
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
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;- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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;EDIT | Also note that in HTML you should refer to things such as "$" as their entity equivalents (i.e. $ or &#xxx;)
ok, now it says there is an error on line 78
oh, and here is the updated (so far) code:
thanks in advance,
-Word32
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;
?>-Word32
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia