File

Sometimes clients need to edit their CSS to make design changes and you have to implement a mechanism in website admin to get CSS, edit it and save it. You can do it in several ways but here is popular one like WordPress use while theme editing. Here it is.

{ 0 comments }

If you want to list all files from a folder automatically by using a PHP script and get them with link then here is a very simple method to do that. This script reads contents of a folder and lists those contents with link to them.

{ 0 comments }

Actually I was having hard time in setting up a database backup script. It was using a function and it was not being controlled easily. If I implemented a simple check that if form was posted then run that db-backup script, it was simply giving call to undefined function. By reloading page backup copies are […]

{ 0 comments }

It is easy to upload file when the Register_Globals are set to ON in the php.ini file (php configuration file) which is not recommended in any case for security reasons. When Globals are OFF then in this case I have tried this script and it works fine. Following is the script. Create two files. one […]

{ 1 comment }

With this PHP script you can find size and type (extension) of required file.

{ 0 comments }

File append means to add on to the existing data, then you need to open the file in append mode.

{ 1 comment }

When you view the contents of a directory you can see all the files that exist in that directory because the operating system or application that you are using displays a list of filenames. You can think of these filenames as links that join the files to the directory you are currently viewing. If you […]

{ 0 comments }

We have to use the function fopen to open the file for reading. Here’s the code to read-open the file.

{ 0 comments }

Now that you know how to open and close a file, lets get on to the most useful part of file manipulation, writing! There is really only one main function that is used to write and it’s logically called fwrite.

{ 0 comments }

The next logical step after you have opened a file and finished your business with it is to close that file down. You don’t want an open file running around on your server taking up resources.

{ 0 comments }