Page 1 of 1

Parse error: parse error, unexpected T_STRING, expecting

Posted: Wed Oct 15, 2003 12:35 am
by cyberpro
I have this error message:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/php/nuevapostal.php on line 105

This is the line 105:

What's the problem?

Code: Select all

Echo "<p align='justify'><b><font face="Verdanas" size='3'>Send<br></font></b><font face="Verdanas" size='2'>Thaks for using this service<p align=center><b><a href='index.php'>Volver</a></font></p>";
Admin Edit: PHP tags added for clarity

Thanks!

Posted: Wed Oct 15, 2003 2:18 am
by jollyjumper
Hi Cyberpro, the problem lies in the font face="Verdanas", you should use single quotes around there because you used double quotes to start the echo. You could also use \" to allow double quotes.

use this:

Code: Select all

<font face='Verdanas' size='3'>
or this:

Code: Select all

<font face="Verdanas" size='3'>
Admin Edit: CODE tags added for clarity

Greetz Jolly.

Posted: Wed Oct 15, 2003 3:30 am
by twigletmac
You can also do:

Code: Select all

echo '<p align="justify"><b><font face="Verdana" size="3">Send<br></font></b><font face="Verdanas" size="2">Thaks for using this service<p align="center"><b><a href="index.php">Volver</a></font></p>';
Try and be consistent with how you use quotes in HTML and it will all become a lot easier.

Mac

Posted: Wed Oct 15, 2003 5:03 am
by Nay
One more way, (yeah, guys, I always have to mention it, don't I? :D) is the heredoc style.

Code: Select all

echo <<< END
<p align="justify">
<font face="verdana" size="3">
<strong>Send</strong>
</font>
</p>

<br />

<font face="verdana" size="2">
Thanks for using this service
<p align="center">
<strong>
<a href="index.php">Volver</a>
</strong>
</p>
</font>
END;
It's something like echo "until" END;. So it'll output everything it sees until END. Neat, eih?

and hehe yeah, I just couldn't stand it and made your code XHTML complaint too :D. Well, not fully complaint but will do.

-Nay

ps: At the end of the day, it's all about preference. You don't really have to "do it properly" in PHP since there are tons of ways to do a thing.

Posted: Wed Oct 15, 2003 5:10 am
by twigletmac
Nay wrote:I just couldn't stand it and made your code XHTML complaint too :D.
:lol: but you didn't replace the font tags or the align attributes...

Mac

Posted: Wed Oct 15, 2003 5:13 am
by Nay
I know :lol:. If I did I would have to be writing a style sheet for him too! Since then I'd be using style="", but I never use style="". I seem to be alergic to it!!

woah, so yea, I use classes and id for all my div and other styles. What a pain, but yeah, it's me :D.

And also, I like to <link rel="stylesheet" href="styles.css" /> rather than make an internal stylesheet. *sighs*

-Nay

Posted: Wed Oct 15, 2003 5:48 am
by volka
link rel= ? tztztz, is it xml or is it not? ;-)
<?xml-stylesheet href="http://www.w3.org/StyleSheets/TR/W3C-REC.css" type="text/css"?>
<?xml-stylesheet href="#internalStyle" type="text/css"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
[...]

Thanks

Posted: Thu Oct 16, 2003 12:41 am
by cyberpro
Thanks!

--------------------------------------------------------------------------------------------------
jollyjumper wrote:Hi Cyberpro, the problem lies in the font face="Verdanas", you should use single quotes around there because you used double quotes to start the echo. You could also use " to allow double quotes.

use this:

Code: Select all

<font face='Verdanas' size='3'>
or this:

Code: Select all

<font face="Verdanas" size='3'>
Admin Edit: CODE tags added for clarity

Greetz Jolly.