note 28319 rejected from function.fopen by nicos
| From: | nicos@php.net | Date: | Thu, 09 Jan 2003 06:46:45 +0000 |
| Subject: | note 28319 rejected from function.fopen by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41890@lists.php.net to get a copy of this message | ||
I'm a newbie to to php and i'm having trouble understanding why i'm getting errors
from my local machine (xp pro IIS 5.0) utilizing the fopen(), fwrite(), and fclose() functions. But,
when i upload it live to my ISP it works flawless! here's my code and the errors that are being
thrown: I hope some one can HELP! It gets confusing when trying to learn this stuff!
<?php
$counter_file = "./count.dat";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter ", date("h:i, jS F");
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
?>
Warning: fopen(./count.dat) [function.fopen]: failed to create stream: Permission denied in
c:\inetpub\wwwroot\struc1\php\hit_counter1.php on line 21
Warning: fwrite(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\struc1\php\hit_counter1.php on line 22
Warning: fclose(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\struc1\php\hit_counter1.php on line 23