Sorry to say it, but that is quite sloppy coding. This highlights why it is
important to give variables meaningful names! In the code below, George has
assigned the location of his file to a pointer, but then over-written it
with the pointer result of fopen.
> $fp2 = "C:\\inetpub\\wwwroot\\packtra
ECTED]
-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 11:18 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Problem writing to a file
Thanks for the pointers guys.
The revised code (it works) is:
$fp2 = "C:\\inetpub\\wwwroot\\packtr
"Cannot write to file ($fp2)";
exit;
}
fclose($fp2);
rename($cr.".txt",$cr.".doc");
It may be of use to someone else.
Cheers
George
> -Original Message-
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: 9 September 2003
"George Pitcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 09, 2003 3:37 PM
Subject: [PHP-WIN] Problem writing to a file
> Hi all,
>
> I'm having a problem writing to a text file.
>
> This is the error message:
> = = = = = = =
Hi all,
I'm having a problem writing to a text file.
This is the error message:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Warning: fwrite():
supplied argument is not a valid stream resource in
C:\Inetpub\wwwroot\packtracker\lse\pub_req_start2.php on line 276
Cannot write