Basic php problem, not parsing this code.

From: Jones (none_at_spamnone.com)
Date: 05/25/04


Date: Tue, 25 May 2004 04:54:22 +0100

For some reason neither my home PC running php 4.3.3 or my rented server
running php 4.3.6 will parse this script.

This is an exercise out of a book that I was recommended on this NG, called
PHP and MySQL Web Development, Second Edition. Everything was going so well
up until now and I have been able to correct all of the errors in the code
myself (where I hadn't typed correctly or where I had been experimenting).
And now I'm stumped.

This has got to be something so simple, but I can't see what it is. The
code isn't being parsed, just returned as a mess in the browser. I had no
problems with it displaying php until now, all of my old files are still
working.

<body>
<table border="0" cellpadding="3">
<tr>
<td bgcolor="#CCCC0C" align="center">Distance</td>
<td bgcolor="#CCCC0C" align="center">Cost</td>
</tr>

<?

$distance = 50;
while ($distance <= 250 )
{
 echo "<tr>\n <td align"="right">$distance</td>\n";
 echo " <td align="right">". $distance / 10 ."</td>\n</tr>\n";
 $distance += 50;
}

?>
</table>
</body>
</html>

I am so sick of Bob's Auto Parts lol.

Any ideas would be much appreciated.

Cheers



Relevant Pages

  • error reporting
    ... I'm running PHP 5.1 on IIS. ... My php.ini has the following error reporting settings: ... I've written a little script that divides by 0. ... command line are below. ...
    (php.general)
  • Re: [PHP] Seg Faulting PHP
    ... I am running PHP 5.2.8 on freebsd 7.0 and am getting a Seg fault when ... This script uses: ... Unadvertised dedicated server deals, too low to print - email me to find out! ...
    (php.general)
  • Re: Apache vs IIS
    ... It's easier to say what could be wrong if seen the code and your iis settings. ... You will see on the Windows box, when you click on a thumbnail, an error message is generated. ... Why are you running PHP as a CGI? ... I only copied the script, so do not understand how to run it as a module. ...
    (alt.php)
  • Re: Apache vs IIS
    ... It's easier to say what could be wrong if seen the code and your iis settings. ... You will see on the Windows box, when you click on a thumbnail, an error message is generated. ... Why are you running PHP as a CGI? ... I only copied the script, so do not understand how to run it as a module. ...
    (alt.php)
  • Re: Apache vs IIS
    ... It's easier to say what could be wrong if seen the code and your iis settings. ... You will see on the Windows box, when you click on a thumbnail, an error message is generated. ... Why are you running PHP as a CGI? ... I only copied the script, so do not understand how to run it as a module. ...
    (alt.php)