Forum Moderators: coopster

Message Too Old, No Replies

Newbie question concerning Parse error

Parse Error

         

founddog

6:03 am on Jul 9, 2006 (gmt 0)



After adding the following information:
<a href="/newsletters/Summer_Fall_schedule.pdf" target="_blank">Download</a>

to line 210

<p><a href="/newsletters/Summer_Fall_schedule.pdf" target="_blank">Download</a> the Summer and Fall Schedule which begins on August 7th.<br />

I receive the following error:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/9/d88739017/htdocs/schedule/index.php on line 210

What can I do to stop receiving this error message when the .php that contains this information is used?

Thank you for looking.

the_nerd

8:51 am on Jul 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try this:

echo '<a href="/newsletters/Summer_Fall_schedule.pdf" target="_blank">Download</a> ';

Everything that is between

<?php

and

?>

has to be corrct php syntax. You can either include the whole file within <$php and?>, then you need e.g. echo .. to output data -

or you can have a "normal" file and whenever you want php to do something just use someting like this: <?php $a=5*5; echo $a?>

hope this helps,

nerd

founddog

5:04 am on Jul 10, 2006 (gmt 0)



This is more context to my issue:

<?php

print "<h1>ABC Spring and Summer Schedule</h1><h2>Effective July 9th</h2></br><p>www.abc.com - 123.548.6541.<br /
<p><a href="newsletters/summer_fall_schedule.pdf" target="_blank">Download</a> the Summer and Fall Schedule.<br />
<p>(Please note that some of the class lengths have changed.)</p><p>(<a href=\"javascript:window.print();\">Print</a>)</p>\n";

After following the_nerds suggestion I still receive the same error message.

Thanks for your help.

dreamcatcher

9:23 am on Jul 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



founddog,

You need to escape the double quotes. Or change your print command to parse between apostrophes.

ie:

print "<a href=\"....";

or

print '<a href=".....';

dc