code works, until I enter the field checking statement right at the top:
<html>
<?
require ("sc_fns.php");
if ($_POST['userfile'] == "")
{
admin_header();
echo "<FONT FACE='ARIAL' SIZE='1' COLOR='FF0000'> <BR><BR>Error. You did not select a file to upload<BR>Please try again, thank you.</FONT>";
do_html_footer();
exit;
}
$POST['userfile'] = addslashes($POST['userfile']);
$POST['userfile_name'] = addslashes($POST['userfile_name']);
$POST['userfile_size'] = addslashes($POST['userfile_size']);
$POST['userfile_type'] = addslashes($POST['userfile_type']);
db_connct();
mysql_select_db("supra_sc");
// insert new image file
$query = "insert into images values
('$userfile_name', '$userfile_size', '$userfile_type')";
$result = mysql_query($query);
if ($result)
echo "<FONT FACE='ARIAL' SIZE='1' COLOR='0000FF'><BR>Thank you. One new image file has been entered into your online store database.</FONT>";
include ("image_upload_form.php");
?>
</body>
</html>
AND HERE IS THE FORM:
<html>
<body>
<?
require ("sc_fns.php");
admin_header();
?>
<BR>
<h1>Upload an image file</h1>
<form enctype="multipart/form-data" action="image_upload.php" method=post>
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Upload this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
</body>
</html>
PRETTY STRAIGHT FORWARD, I MUST BE MISSING SOMETHING BASIC?