Hi randy, hope this helps.
Make the form like this:
<FORM ENCTYPE="multipart/form-data" ACTION="which_scriptis_parsingit" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="IN_BYTES"> // If the files exceeds this, your receiving php script will report that no such variable exists
Send this file: <INPUT NAME="the_variable" TYPE="file">
<INPUT TYPE="submit" VALUE="Upload">
</FORM>
Then in the next script you use,
there will be three variables automatically created by PHP (the following is PHP3,but works in PHP4 also). They are $variable_name (the data itself),$variable_name_type , $variable_name_size,$variable_name_name (the name of the file).
In the processing script, insert whatever values you want (most importantly $variable-name and $variable_name_type) into your database, and make the field for the data a BLOB. You shuold save the type (which will be a mime type -> ex:image/jpeg ) so that when you send it to a browser , it knows whether it is a gif or jpeg , or png,etc.
When you want to retrieve the file, simply do this.
Retrieve the file data from the data field in the DB and also the type.
then
Header( "Content-type: $type "); // type is the type you saved and then retrieved from the DB
echo $data; // this is the datastream
Save this script as something like picture.php. Then you can get the pictures using <IMG SRC="picture.php?imageid=$id>.
Hope it helps.