This is a minimalistic guide on how to handle file uploads using PHP and XHTML forms. Prerequisites are basic XHTML and PHP skills.
Step 1: Creating an XHTML form
A form needs to be created through which a user can select the file that needs to be uploaded and pass it on to the PHP script which uploads the file. It's a very simple form using the "input type=file" attribute.
Step 2: Processing the upload
Now comes the PHP part. The approach I use here is to make use of the move_uploaded_file()[1] and the global $_FILES variable.
Notes
- Provide your file with sufficient permissions, ie. the requisite write permissions in your operating system
- Modify the $uploaddir variable suitably to point to the writable folder where you want to save the uploaded files

