strange
| From: | Bill Brennick | Date: | Mon, 18 Dec 2000 19:26:57 +0000 |
| Subject: | strange | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30890@lists.php.net to get a copy of this message | ||
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