sean14592 Posted June 6, 2008 Share Posted June 6, 2008 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 More sharing options...
jesushax Posted June 6, 2008 Share Posted June 6, 2008 try if (strlen($_SESSION['photo1']) < 0 ) Link to comment https://forums.phpfreaks.com/topic/108988-solved-file-upload-problem/#findComment-559137 Share on other sites More sharing options...
sean14592 Posted June 6, 2008 Author Share Posted June 6, 2008 nope, still no error, when i don't enter anything sean Link to comment https://forums.phpfreaks.com/topic/108988-solved-file-upload-problem/#findComment-559143 Share on other sites More sharing options...
sean14592 Posted June 6, 2008 Author Share Posted June 6, 2008 FIXED! if($_FILES['photo1']['size'] == 0 ) Thanks anyway Sean Link to comment https://forums.phpfreaks.com/topic/108988-solved-file-upload-problem/#findComment-559145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.