Daney11 Posted March 6, 2008 Share Posted March 6, 2008 Hey guys, Im using if(!empty($_POST['file'])) { $file_name = 'NULL'; } if(!in_array($ext,$allowed_filetypes, $_POST['file'])){ $errors[] = 'Please Make Sure Your File Is Below 512kb In Size and is in .gif Format'; } Basically i want my code to find out if <input name="file" type="file" /> Is empy or is it has a location set inside it. If it is empy i want the $file_name to be NULL. Link to comment https://forums.phpfreaks.com/topic/94769-if-and-empty/ Share on other sites More sharing options...
wildteen88 Posted March 6, 2008 Share Posted March 6, 2008 If you are using a file field you wont use $_POST['file'] you'd use $_FILES['file']['name']; Link to comment https://forums.phpfreaks.com/topic/94769-if-and-empty/#findComment-485268 Share on other sites More sharing options...
Daney11 Posted March 6, 2008 Author Share Posted March 6, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/94769-if-and-empty/#findComment-485272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.