Jump to content

[SOLVED] File Upload problem


sean14592

Recommended Posts

Hi, For some reason, when I enter nothing in the file field named 'photo1' and then go to the next step to check if the field is empty, it isen't returning empty. weird!

 

$_SESSION['photo1'] = $_FILES['photo1'];


//Check if above is empty

if ((empty($_SESSION['photo1'])) || (!isset($_SESSION['photo1'])))
{
echo '<br><center>';
echo 'Opps! Looks like we have a problem....<br><br>';
echo '<b>Error: <FONT COLOR="#FF3300"><u>Photo 1 Field Empty!</u></b></font>';
echo '<br><br><a href="'.$siteurl.'index.php?p=oaddprop11"><img src="'.$siteurl.'style/form/fix_error.gif" width="240" height="40" border="0" /></a>';
exit;
}

 

Is that right?

 

Cheers

Sean

Link to comment
https://forums.phpfreaks.com/topic/108988-solved-file-upload-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.