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:
or this:
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?

) 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

. 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

.

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

. 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

.
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?
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:
or this:
Admin Edit: CODE tags added for clarity
Greetz Jolly.