sirup_segar Posted May 26, 2007 Share Posted May 26, 2007 how to use file field tag to determine that it is empty? Link to comment https://forums.phpfreaks.com/topic/53028-file-field/ Share on other sites More sharing options...
neel_basu Posted May 26, 2007 Share Posted May 26, 2007 empty() Link to comment https://forums.phpfreaks.com/topic/53028-file-field/#findComment-261965 Share on other sites More sharing options...
sirup_segar Posted May 26, 2007 Author Share Posted May 26, 2007 i use html tag <input name="Uplgbr" type="file" size="42"> can it use with if empty($Uplgbr)? i've tried but it doesn't check if the value of $Uplgbr is empty (i don't choose a new file, i let it empty)thankx alot bro.. Link to comment https://forums.phpfreaks.com/topic/53028-file-field/#findComment-261971 Share on other sites More sharing options...
neel_basu Posted May 26, 2007 Share Posted May 26, 2007 if empty($_POST['Uplgbr']) use $_GET if you use get method. else use if(empty($_FILES['userfile']['name'])) the second one is the best way to check wheather user have uploaded anything or not. Link to comment https://forums.phpfreaks.com/topic/53028-file-field/#findComment-261972 Share on other sites More sharing options...
sirup_segar Posted May 28, 2007 Author Share Posted May 28, 2007 thanks, it runs on my localhost. but when i upload it to webserver, nothing happens when i add if(empty($_FILES['userfile']['name'])), it doesn't chek at all.. what should i do Link to comment https://forums.phpfreaks.com/topic/53028-file-field/#findComment-262992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.