PHP File Operations tutorials
Looking for a way to save a PHP page as a word doc programatically?
Related Tutorials
Saving a PHP File as a Word Document
So you are looking for a way to save a PHP page as a word doc programatically? Then you have come to the right place.
Saving Data into Excel the Easy Way
PHP: If youre looking for an easy way to output your data from a PHP script into a Excel file, youve got to check out this script MS Excel Stream Handler which I came across at the PHP Classes site.
Creating Dynamic PDF files using HTML and PHP
Some may need to convert some text into HTML and some may need to convert some HTML content to an image format. The main reason for the need to convert from one file format to another is because the target file format is best suited for targeted medium where the content need to be displayed. The targeted medium may be an email, a printed hard copy or a web browser. The text format is best suited for sending emails, as the possibility of the email contents getting corrupted in the transition is much lesser, when compared to the HTML formatted emails. PDF document or a word document would be the best choice for taking a printed hard copy and obviously HTML is best for showing contents in web browsers.
Opening a file in PHP
When you open a file in PHP one of the first things you have to think about is what mode do you wish to open the file, Do you want to create a new file, Do you wish to open an existing file and add more data or do you wish to read data from an existing file. Some of the most common modes are displayed below.
Creating Word, Excel and CSV files with PHP
In this article we demonstrate several ways to create Microsoft Word and Excel documents, and also CSV files using PHP. Learn how to create files using HTTP headers, COM objects, OpenOffice templates, fputcsv function.
XML and PHP Simplified - XML,PHP and the Database
J. Leidago Noabeb explores the relationship between XML,PHP and MYSQL including a brief look at the Document Object Model.
Reading the clean text from PDF
Portable Document Format (PDF) is a file format created for the document exchange. Let's read the plain text from PDF file.
Simple Image Resize in GD
Were going to be creating it in a function, so that we can re-use this wherever we need to. This particular function saves the thumbnail file to a directory on the server, you could actually skip saving the file and just print out the image itself if you would prefer to do that.
Installing PHP 4.x for Apache 1.x.x on Linux
This document describes how to install PHP for Apache on Linux. It was written using Red Hat 7.0, Apache 1.3.14 and PHP 4.0.3 patch level 1 You should have Apache installed before trying to install PHP.
XML and PHP Simplified
In this article we will continue to look at the create document script, focusing on the HTML portion of the code. Then we will continue to look at the document editor script, which is at the heart of the program.
File Uploader
In this tutorial I'll show you how to make a php script to act as a File Uploader that doesn't allow other PHP scripts to be uploaded.
Writing to a file
In php we use the fwrite function to write data to a file, this takes 2 parameters. The first parameter is the file handle which we specified in our Creating a file tutorial, the second is the actual data we wish to write to the file.
Saving Movie Clip Positions with PHP and MySQL
Good understanding of Flash Actionscript is required to complete this tutorial. What this tutorial basically does is to show you how to set up a table in a mySQL database, then using PHP (or asp with a few minor changes) manipulate that table and interact with Flash.
Secure File Upload with PHP
PHP makes uploading files easy. You can upload any type of file to your Web server. But with ease comes danger and you should be careful when allowing file uploads.In spite of security issues that should be addressed before enabling file uploads, the actual mechanisms to allow this are straight forward. In this tutorial we will consider how to upload files to some directory on your Web server. We will also discuss security issues concerned with the file uploading.
PHP Syntax
This tutorial describes: How to begin and end a PHP code block, How a PHP input file will be processed, How to enter comments in a PHP code block.
Transforming XML with XSLT and PHP
In this tutorial we will use XSLT to transform an XML document into an HTML document and use PHP's XSLT functions to apply those rules.
File Downloads with Speed Limit
PHP can be used to securely control access to file downloads. This tutorial will show how you can send file through a PHP script and limit the download rate. The function we will write accepts the path to the file to send and optionally a rate in kB/s to limit the transfer speed. The function should also be able to handle range headers from clients that allow stopping and resuming downloads.
HTML Templates
Most sites use a standard template throughout the whole website. The header and footer data is stored in a .php file and loaded for each page allowing easy maintenance. This tutorial will show you how to get PHP to dynamically choose which file to include based upon the page currently being viewed.
Creating files with PHP
To create a file in PHP you use the fopen function, this is the same function that is used to open files but if it does not find the file specified it will create a brand new file for you.
PHP Messagebox
Easily create a PHP Message Box, without using any mysql! Using this method, when your visitors post something, the simple script interprets it, and stores the message in a text document. It is also fully customizable with HTML.
PHP File operations
Using files in php is very simple, here i will teach you very basic file operations.
PHP Script Tips - Uploading Files to Web Servers
A collection of 12 tips on uploading files with PHP pages. Clear explanations and tutorial exercises are provided on creating file upload HTML tags, setting encoding type on HTML forms, getting uploaded file information, storing uploaded file in database.
PHP Script Tips - Reading and Writing Files
A collection of 14 tips on PHP functions on file input and output. Clear answers are provided with tutorial exercises on opening files for reading and writing, appending data to existing files, reading file by line or character, reading file in binary mode.
PHP file uploader
Want to make a simple PHP file uploader for your site? Here it is!
File Upload
In this tutorial we'll be creating a basic File Upload System. This tutorial only requires you (preferably) to have a basic understanding about PHP variables and loops. Although, some pre knowledge about PHP arrays wouldn't hurt either!
Sneak past the PHP upload limits
How to sneak past the settings in your php.ini file that limits the file uploads - with out changing php.ini
Introduction to SQLite
Many people have heard of SQLite but not many people have used it in their PHP applications. Most PHP applications make use of the MySQL database engine to store information however this is not always needed for small amounts of data. In these cases, web applications often store their data in a "flat file" format, often just a plain text file or an XML file. Both of these methods have their downsides.
Saving Sessions in a File
How to save session information from one session to another.
PHP/MySQL RSS Feed
Setup your own RSS feed that pulls data from your PHP/MySQL-driven web site. Use PHP to create the XML/RSS document RSS Readers require to inform visitors of your web site database's content updates.
PHP/MySQL RSS Feed
Setup your own RSS feed that pulls data from your PHP/MySQL-driven web site. Use PHP to create the XML/RSS document RSS Readers require to inform visitors of your web site database's content updates. The tutorial is available in PDF format.
Understand Sessions
Understand Session is important to improve you Php knowledge. When in you php you decide that you want to start a session (we'll see it soon) Php will create a unique identifier and an associated file that will be stored on the server.
PHP Form Image Upload
This tutorial shows you how to upload an image on your server using PHP and html forms. You will also learn how to verify if the uploaded file is an image (checking the extension), if it doesn't overtakes a size limit and how to change the uploaded file name.
PHP Layouts
Make your Website layouts with PHP so you have on layout file so you only need to edit one file to change the layout.
Banner Rotation Using PHP
Creating a simple ad-rotator, the ads are stored in a text file and picked randomly by this PHP code. Most of the webmaster use banner ads, we will be creating a very simple banner rotator, which picks up randomly one ad from the banner file and displays it, this file can be called in any other page to display the banners.
PHP File Handling
We can use PHP to open files and manipulate the data contained within them.
Reading Files in PHP
In this section we are going to cover how to open and read file content in PHP.
Working with Directories and Files
A collection of 8 tips on PHP functions for working with file systems: 1. How To Create a Directory? 2. How To Remove an Empty Directory? 3. How To Remove a File? 4. How To Copy a File? 5. How To Dump the Contents of a Directory into an Array? 6. How To Read a Directory One Entry at a Time? 7. How To Get the Directory Name out of a File Path Name? 8. How To Break a File Path Name into Parts?
PHP Script Tips - Understanding and Managing Sessions
A collection of 19 tips on understanding and using sessions in PHP. Clear explanations and tutorial exercises are provided on starting and closing sessions, saving and retrieving values in sessions, deciding how session IDs to be transferred, deciding where to store session files, deciding when to expire session values, etc.
Upload single file
Simple PHP uploading file scripts.
PHP File System
We will discuss the common filesystem functions available to you. First of all, in order to do anything with a file, we must first open it.
 
Categories