#38816 [NEW]: PHP code that was working perfectly recently stopped.
| From: | mtoohee at gmail dot com | Date: | Wed, 13 Sep 2006 21:40:58 +0000 |
| Subject: | #38816 [NEW]: PHP code that was working perfectly recently stopped. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-102136@lists.php.net to get a copy of this message | ||
From: mtoohee at gmail dot com
Operating system: winxp
PHP version: 4.4.4
PHP Bug Type: *General Issues
Bug description: PHP code that was working perfectly recently stopped.
Description:
------------
Hi. I am the author of a quiz done in flash which uses php to keep track
of a scoreboard. I got the php code off a nice guy on the internet. Anyway
the scoreboard was working perfect for a year but then recently it just
stiopped working. And when I try to view the score board in html
(http://quiz.thedrunkenclam.com/scores.php?filename=scores/fgquiz3586.sco&scoresize=50&action=VIEW&viewtype=HTML)
I get the following error message:
Warning: fclose(): supplied argument is not a valid stream resource in
/home/hogie/public_html/quiz/scores.php on line 9
I'm wondering if this is a bug to do with a newer version of php as I have
not touched the php code since I implemented it about a year ago. A quick
answer would be greatly appreciated. It's justy annoying that something
works well for a year and then all of a sudden stops working. Okay thanks
for listening.
Reproduce code:
---------------
Here's the first few lines of code where the error occurs:
<?php
$winscore = (int)$winscore;
// Create a Blank File if it doesn't already exist
if (!file_exists($filename))
{
$file=fopen($filename, "w");
fclose ($file);
}
// Read the file in
$oscores = file ($filename);
$numreadin = count($oscores);
Expected result:
----------------
A scoreboard list of fifty people and they're respective scores.
Actual result:
--------------
Warning: fclose(): supplied argument is not a valid stream resource in
/home/hogie/public_html/quiz/scores.php on line 9
--
Edit bug report at http://bugs.php.net/?id=38816&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38816&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38816&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38816&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38816&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38816&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38816&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38816&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38816&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38816&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38816&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38816&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38816&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38816&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38816&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38816&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38816&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38816&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38816&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38816&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38816&r=mysqlcfg