Forum Moderators: coopster

Message Too Old, No Replies

help, parse error...

         

mamo

5:20 pm on Jan 20, 2005 (gmt 0)

10+ Year Member



Parse error: parse error, unexpected T_STRING, expecting ',' or ';' on line 141

."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"840\">\n"

."<tr><td width=\"100%\" height=\"88\" bgcolor=\"#FFFFFF\">\n"

."<table border=\"0\" width=100% cellpadding=0 cellspacing=0><tr><td align=\"left\"><a href=\"index.php\"><img border=\"0\" src=\"themes/DeepBlue/images/logo.gif\" alt=\"Welcome to $sitename!\" hspace=\"5\"></a></td><td align=\"right\">\n"

line 141<--> ."<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\"473\" HEIGHT=\"88\" id=\"firmfx\">

."<PARAM NAME=\"movie\" VALUE=\"firmfx.swf\"> <PARAM NAME=\"quality\" VALUE=\"high\"> <PARAM NAME=\"bgcolor\" VALUE=\"#FFFFFF\"> <EMBED src=\"firmfx.swf\" quality=\"high\" bgcolor=\"#FFFFFF\" WIDTH=\"473\" HEIGHT=\"88\" NAME=\"firmfx\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>

."</OBJECT>

."</td>

."</tr></table>

Thanks for your help!

dreamcatcher

5:28 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi mamo, welcome to Webmaster World.

I think your problem is that you are not terminating anything with a semi colon.

:)

mamo

5:35 pm on Jan 20, 2005 (gmt 0)

10+ Year Member



hey thanks, so do i need to put a semicolon after each line?

mincklerstraat

6:18 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, your code there is a bit tricky since it uses "concatenators" (the dot or period), and goes over multiple lines. You only need semicolons after each PHP line, which doesn't always correspond to the lines in the file.

Just googled php.net for 'concatenator' and it showed up close to nadda, either google is having a bad hair day or Mr. Bakken forgot something. A concatenator basically takes two strings, or two expressions, or whatever, and sticks them together - so


$string = 'this';
echo $string.' is a string';

is the same as echo 'this is a string';
PHP isn't sensitive to whitespace, so when your code goes over multiple lines, PHP doesn't care.

$string = 'this
will
work'
.' indeed it'
.'will';

Here we have line breaks without concatenators - since the string wasn't ended with a quote, no concatenators needed - then we have line breaks with concatenators, necessary since the strings end, and are thus separate units of code (tokens); this is all just one line of PHP, even though it's a number of lines in a file. All is ended with a semicolon, as all nice lines of PHP are.
You might want to have a look at the tutorial [be.php.net] on syntax, these things can get confusing and sometimes you need to read stuff a few times before it sinks in (in my case at least).

dreamcatcher

6:21 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks mincklerstraat, that saved me some time. :)

mamo

6:57 pm on Jan 20, 2005 (gmt 0)

10+ Year Member



Fixed it! Thanks so much

[edited by: jatar_k at 7:00 pm (utc) on Jan. 20, 2005]
[edit reason] no personal urls thanks [/edit]

mincklerstraat

7:01 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good job, mamo; Dreamcatcher, hope you had a nice time in HK.

dreamcatcher

8:32 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dreamcatcher, hope you had a nice time in HK.

Fabulous. I`m trying my hardest to forget I`m back in England. Unfortunately, the rain is a constant reminder :(