I have a hosting site on a GoDaddy server - using the same php code and same tab-delimited data files. Godaddy no longer supports php4 - and my code no longer works. If some body could take a look and suggest what I might be doing wrong I’d be very appreciative!
The error I’m getting is “Warning: Invalid argument supplied for foreach() in /home/content/n/i/b/nibrs/html/cgi/property.php on line 43”
Code follows:
[code]
Crime Reporting Unit Property ReportNote: The Following table is a property stolen, with the data converted from NIBRS cases reported by this agency for the year in question.
<?php$filename = “/home/content/n/i/b/nibrs/html/datafiles/prop.dat”; //here’s the filename
$id = fopen($filename, “r”); //open the file
while ($data = fgetcsv($id, filesize($filename),"\t")) //start a loop
echo “
$data[0]\n”;
if ($data[1] == “$ori” and $data[2] == “$year”)
$table[] = $data; //put each line into its own entry in the $table array
fclose($id); //close file
echo “
Agency | <td align='center’rowspan=‘2’>ORI<td align='center’rowspan=‘2’>Year<td align='center’rowspan=‘2’>Month<td align='center’colspan=‘7’>Robbery by Location<td align='center’colspan=‘2’>Burglary by Location<td align='center’colspan=‘3’>Larceny by Value<td align='center’colspan=‘9’>Nature of LarcenyMonths | ||||||||||||||||||||
Hiway | Comm. House | Gas Station | Conv. Store | Residence | Bank | Misc | Residence | Non- Residence | $200 and Over | $50 - $200 | Under $50 | Pocket- picking | Purse Snatching | Shop lifting | From Motor Veh | MV Parts/Access | Bicycle | From Building | Coin- op | All Other | Reporting |
?>
[/code]Thanks!
Dan B