calmchess Posted December 24, 2007 Share Posted December 24, 2007 I am trying to use an if statement to see check and make sure the uploaded file part of my form is not null but it always says that it is null even when i am sure its not....how do i use a if statement with a upload form??I have no problem doing this with plain text data just with an upload }; <? if(!$_POST['uploaded']{ echo "no file being uploaded"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/83038-post-data-if-statement-question/ Share on other sites More sharing options...
pocobueno1388 Posted December 24, 2007 Share Posted December 24, 2007 Your missing a parenthesis in your if statement. Also, you should use isset(). if(!isset($_POST['uploaded'])){ echo "no file being uploaded"; } Quote Link to comment https://forums.phpfreaks.com/topic/83038-post-data-if-statement-question/#findComment-422375 Share on other sites More sharing options...
PFMaBiSmAd Posted December 24, 2007 Share Posted December 24, 2007 An upload form sets the $_FILES array not the $_POST array. Reading this link on how to handle upload files will probably help - http://www.php.net/manual/en/features.file-upload.php Quote Link to comment https://forums.phpfreaks.com/topic/83038-post-data-if-statement-question/#findComment-422378 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.