PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to impliment a simple counter that uses a text file to write to. I am putting the code below. My problem is that when it gets to the rewind part it errors and gives the following message:
Warning: Supplied resource is not a valid File-Handle resource in /usr/local/home/domain.com/httpdocs/count.php on line 6
Here is my code....any ideas or fixes would be greatly appreciated as always.
However, this just gets me errors. I also tried the tutorials on the devnetwork site but cannot get anything with those either. Can somebody please, please help me or point me to something that works? Thanks so very much!!!!
try that, and no - you can't open files on other servers using the functions you used, most php functions for filesystem only apply to files on the users own filesystem
You can't open other sites things cos of security issues and other things... Like if you can read PHP file that stores username and password that's is BAD...
* fopen() can be used to open file or URL.
* HTTP connections are read-only; you cannot write data or copy files to an HTTP resource.
* You can open files for either reading or writing via ftp (but not both simultaneously). If the remote file already exists on the ftp server and you attempt to open it for writing, this will fail.
* If you need to update existing files over ftp, use ftp_connect().
I am currently working on the sample code for "easy php counter". Will post the code...