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 Quote 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 ) Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/108988-solved-file-upload-problem/#findComment-559145 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.