#38816 [Opn]: PHP code that was working perfectly recently stopped working.
| From: | mtoohee at gmail dot com | Date: | Wed, 13 Sep 2006 21:41:51 +0000 |
| Subject: | #38816 [Opn]: PHP code that was working perfectly recently stopped working. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-102137@lists.php.net to get a copy of this message | ||
ID: 38816
User updated by: mtoohee at gmail dot com
-Summary: PHP code that was working perfectly recently stopped.
Reported By: mtoohee at gmail dot com
Status: Open
Bug Type: *General Issues
Operating System: winxp
PHP Version: 4.4.4
New Comment:
c
Previous Comments:
------------------------------------------------------------------------
[2006-09-13 21:40:57] mtoohee at gmail dot com
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 this bug report at http://bugs.php.net/?id=38816&edit=1