sirup_segar Posted May 26, 2007 Share Posted May 26, 2007 how to use file field tag to determine that it is empty? Quote 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() Quote 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.. Quote 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. Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/53028-file-field/#findComment-262992 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.