monkeytooth Posted August 31, 2009 Share Posted August 31, 2009 Ok, troubles.. I am making a small image upload script.. my issue is with this one variable. $img = pathinfo($_FILES['file']['name']); It creates an array like format so I can catch the file name prior to extension and the extension. My issue is I am noticing while testing if on the off chance I leave the input for the file empty I error my upload script. So I am trying to determine how I can catch if its empty so if it is, I can define an error to echo/print out. Only problem is everything I am trying doesnt seem to work. empty($img) !empty($img) if($img == "") if(!$img) none of those seem to work for me. so I am kinda stuck, any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/172548-solved-file-upload-array/ Share on other sites More sharing options...
monkeytooth Posted August 31, 2009 Author Share Posted August 31, 2009 never mind, I seemed to have answered my own question.. sometimes displaying it for all to see opens ones eyes. Quote Link to comment https://forums.phpfreaks.com/topic/172548-solved-file-upload-array/#findComment-909576 Share on other sites More sharing options...
monkeytooth Posted August 31, 2009 Author Share Posted August 31, 2009 for reference to help anyone else stuck on similar in the future... just like with $_post and $_get vars.. if you wanna know if its set, !$_FILES['inputname'] Quote Link to comment https://forums.phpfreaks.com/topic/172548-solved-file-upload-array/#findComment-909577 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.