Re: Not a Valid File-Handle Resource

From: Date: Tue, 30 Jul 2002 11:14:12 +0000
Subject: Re: Not a Valid File-Handle Resource
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110340@lists.php.net to get a copy of this message
Chris Carlson wrote: > I am trying to create a php program and am getting an error in this area > of my script: > > $dataFile = > @fopen("/home/blurredv/data/".$username."Contact.txt","w"); > fputs($dataFile, $line); > fclose ($dataFile); > > These are the errors: > > Warning: Supplied argument is not a valid File-Handle resource in > /home/blurredv/public_html/redcarbon/update.php on line 34 > Warning: Supplied argument is not a valid File-Handle resource in > /home/blurredv/public_html/redcarbon/update.php on line 35 > > Note: My script work perfectly with different path names under Windows > NT. Do I have to do something special for Unix. > > Thanks in advance, At a guess, the value you are using as a filename is incorrect, but you are suppressing any error message from fopen - better that you test that result and be prepared to handle an error situation. For a further guess, the value $username doesn't have a trailing slash. -- David Robley NUMBER CRUNCHING: Jumping on a Computer.

« previous php.general (#110340) next »