SRL Archive - Web Development

PHP code throwing an error on Apache


Bad Processor

2011-11-27 15:53:53

[PHP]$j=$_GET['i'];
echo $j.'<br>';
$i=intval(j);
while ($i>0)
{
echo '$i is '.$i.'. <br>';
$i–;
}[/PHP]

This code is throwing an error on Apache.
I know PHP is working right.

Geo

2011-11-27 16:37:10

You forget the $ on line 3

 $i = intval([b]$[/b]j); 

Wizzup?

2011-11-27 19:14:59

Have a look at http://php.net/manual/en/function.error-reporting.php to prevent this in the future.