Hi,
I have a script that lets users upload files etc, but I have also put in place an option for them to edit the file, i.e replace it with a new one.
The data is all stored in a db.
Now, I have set up the following simple script here as my other page is quite long, but as you can see, it doesn't actually work...
<?
if (!$submit)
{
?>
<form action="<? echo $PHP_SELF; ?>" method="POST" enctype="multipart/form-data">
<input name="file" type="file" id="file">
<input type="Submit" name="submit" value="Update">
</form>
<?
}
// form submitted
// start processing it
else
{
if (!empty($file)) {
echo "EMPTY";
} else {
echo "NOT EMPTY";
}
}
?>
Why is it telling me the file is empty, even when I have choosen something using the browse?
Any ideas?
Cheers,
Chris