Jump to content

Fatal error: Call to a member function read() on a non-object in


DrumDude

Recommended Posts

Hi,
I am totally new to PHP scripting but had to upgrade Apache and PHP because of security issues.
I upgraded from Apache 1.3.x and PHP 4.2.3 to Apache 2.0.54 and PHP 5.0.5.
I now get this error on my index.php page:
Fatal error: Call to a member function read() on a non-object on line 89.
Here is the code I will insert#89 so you know which line 89 is.
>
<?php

$fileHandle = fopen("dlconfig2.txt", "r");
while (!feof($fileHandle)) {

$aLine = fgets($fileHandle, 4096);
parse_str($aLine);


}
fclose($fileHandle);

for ($i = 0; $i < count($dropType); $i++) {
$typeToPrefix[$dropType[$i]] = $dropPrefix[$i];
}

$aDirectory = dir("");

#89 while ($anEntry = $aDirectory->read()) {

// Short cut because we know aDirectory only contains other directories.
if ($anEntry != "." && $anEntry!="..") {
$aDropDirectory = dir("");
$fileCount = 0;
while ($aDropEntry = $aDropDirectory->read()) {
if ((stristr($aDropEntry, ".html")))  {
// Count the files in the directory
$fileCount = $fileCount + 1;
}
}
$aDropDirectory.closedir();

$parts = explode("-", $anEntry);
if (count($parts) == 3) {

$buckets[$parts[0]][] = $anEntry;

$timePart = $parts[2];
$year = substr($timePart, 0, 4);
$month = substr($timePart, 4, 2);
$day = substr($timePart, 6, 2);
$hour = substr($timePart,8,2);
$minute = substr($timePart,10,2);
$timeStamp = mktime($hour, $minute, 0, $month, $day, $year);

$timeStamps[$anEntry] = date("D, j M Y H:i (O)", $timeStamp);

if ($timeStamp > $latestTimeStamp[$parts[0]]) {
$latestTimeStamp[$parts[0]] = $timeStamp;
$latestFile[$parts[0]] = $anEntry;
}
}
}
}

?>

Thanks for any help...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.