I am having trouble with Chapter 7, page 197 of the PHP5 book with getting file upload to work with the code in "upload_image.php" which provides interface to browse for your file to upload:
The code:
---------------------------------------------------------------
<form name="form1" method = "post" action="check_image.php"
enctype="multipart/form-data>
<table ... etc
etc...
<tr>
<td><input name="image_filename" type="file" d="image_filename"></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit">
---------------------------------------------------------------------
I run this code and the form appears OK in the Browser. Then enter the data and browse for the file to upload, and then click Submit to run "check_image.php".
All the $_POST data is passed except for the file_name so the code fails with a bunch of error messages.
I have tried for days to get this to work and began to wonder if there were something wrong in my configuration.
I searched for clues in forums and code snippets. I found a set of code at
http://px.sklar.com/
"PX: the PHP code exchange" called "Easy PHP Upload 2.24 by Olaf" which uses class functions.
The download for this is at
http://px.sklar.com/section.html?id=14.
This uses "enctype="multipart/form-data" file browser and all the $_POST variables are passed so the code works (after I modified it to fit my directories). So I must be configured properly.
I am using PHP 5.04, Apache 2.0.54 for Windows XP. Also MySQL.
Any ideas why this won't work would be appreciated.