php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38816 PHP code that was working perfectly recently stopped working.
Submitted: 2006-09-13 21:40 UTC Modified: 2006-09-14 08:22 UTC
From: mtoohee at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.4.4 OS: winxp
Private report: No CVE-ID: None
 [2006-09-13 21:40 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-13 21:41 UTC] mtoohee at gmail dot com
c
 [2006-09-14 08:22 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 17:01:36 2024 UTC