PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Aug 22, 2019 12:50 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Mar 10, 2006 3:53 pm 
Offline
Forum Newbie

Joined: Sun Mar 05, 2006 12:35 pm
Posts: 14
Okay I want to make a log file as everyone logs on, the problem is that I ahven't dealt with chmod much. I am planning on hiding access to the file using .htlogfile.txt here
Syntax: [ Download ] [ Hide ]
//Logfile

    $file = fopen(".htmytextfile.txt","a");



   if (flock($file, LOCK_EX)){ // do an exclusive lock

   

   fwrite($file, "Write something here\n");

   flock($file, LOCK_UN); // release the lock

    } else {

   echo "Can't Logon' !";

   }



    fclose($file);

   //Logfile is basically what I want to do.


The problem is that it gives me errors of
Warning: fopen(.htmytextfile.txt): failed to open stream: Permission denied in /Users/bsucs/Sites/login.php on line 29

Warning: flock(): supplied argument is not a valid stream resource in /Users/bsucs/Sites/login.php on line 31
Can't Logon' !
Warning: fclose(): supplied argument is not a valid stream resource in /Users/bsucs/Sites/login.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at /Users/bsucs/Sites/login.php:29) in /Users/bsucs/Sites/login.php on line 50


I am pretty sure these are caused by chmod. How can I change hte chmod to what I want it to be through the php? I went here but I am not sure what to do cause I do not ever use this chmod stuff.

I got some help, thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group