You are here: Re: Parser Error with Double Quotes « PHP Programming Language « IT news, forums, messages
Re: Parser Error with Double Quotes

Posted by Geoff Berrow on 11/12/42 11:44

Message-ID: <1144571725.079727.135950@u72g2000cwu.googlegroups.com> from
SharkHunter contained the following:

><html>
><head>
><TITLE>Find my Favorite Movie!</TITLE>
></head>
><body>
><?php
>echo "Click here to see information about my favorite movie!";
>echo "</a>";
>?>
></body>
></html>

Nothing wrong with that. I think you have missed out the bit that as
causing the error.

I suspect your original script looked like this:


<?php
echo "<a href="somepage.php" >Click here to see information about my
favorite movie!";
echo "</a>";
?>

The quotes in the anchor tag need to be escaped (ie preceded by a
backslash like so \" ) or replaced with single quotes.

Having said that, there is no need for double quotes unless the echoed
part contains a variable which you want to expand. Therefore using
single quotes is fine. e.g.

<?php
echo '<a href="somepage.php" >Click here to see information about my
favorite movie!';
echo '</a>';
?>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация