Re: strange

From: Date: Mon, 18 Dec 2000 19:38:05 +0000
Subject: Re: strange
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30898@lists.php.net to get a copy of this message
Hi Bill! try replacing your 1st for construction with for( $y=1; $y<=12; $y++ ) regards Marcelo Gulin Bill Brennick escribió: > 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

« previous php.general (#30898) next »