Re: strange
| From: | Philip Olson | Date: | Mon, 18 Dec 2000 19:39:21 +0000 |
| Subject: | Re: strange | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30897@lists.php.net to get a copy of this message | ||
Hey Bill-
print "<TABLE BORDER="1">\n";
Will never work, try :
print '<TABLE BORDER="1">' . "\n";
Or
print "<TABLE BORDER=\"1\">\n";
But optimally, check out this wonderful string tutorial :
http://www.zend.com/zend/tut/using-strings.php
So, it's a typo in the book :-)
Regards,
Philip
--.sig
[ Want to write Good code? First, write Bad code. ]
On Mon, 18 Dec 2000, Bill Brennick wrote:
> Hi all,
> I'm trying this test script I got out of a SAMS book,
> and found something strange which isn't consistent with the book.
> First off, I'm using SuSE-7, with Apache 1.3.14, and the newest PHP4...
>
> Here's the (character-for-character) script in the book:
> (It's to create a simple multiplication table...)
>
> <?php
> print "<TABLE BORDER="1">\n";
> for ( $y=1' $y=<=12; $y++ )
> {
> print "<TR>\n";
> for ( $x=1; $x<=12; $x++ )
> {
> print "\t<TD>";
> print ($x*$y);
> print "</TD>\n";
> }
> print "</TR>\n";
> }
> print "</TABLE>";
> ?>
>
>
> When I run this script, I get this error:
>
> "Parse error: parse error in /home/bbrennick/public_html/php/nineteenth.php
> on line 2"
>
>
>
>
> Here is the modification I did to the script:
>
> <?php
> print "<table border=1>\n";
> for ( $y=1; $y<=12; $y++ )
> {
> print "<TR>\n";
> for ( $x=1; $x<=12; $x++ )
> {
> print "\t<TD>";
> print ($x*$y);
> print "</TD>\n";
> }
> print "</TR>\n";
> }
> print "</TABLE>";
> ?>
>
>
> Once I did that, with line 2, it works fine...
>
> My question is:
> Is that a 'typo' in the book? or is there something
> freaky going on with my web-server? (apache/php4/etc...)
>
>
> Thanks...
> - B
>
>