hadoob024 Posted July 10, 2006 Share Posted July 10, 2006 I can't seem to figure this one out. On my site, I have a real estate listing form. One of the fields is for the user to be able to upload a picture. Now, when I access this page on my PC at home, I have no problems. The error handling and security checks work fine. Regardless of whether I input info for this picture field, the form processor works.However, whenever I try and submit this form using a BlackBerry, I keep getting the following error message:"Error Message: Undefined index: picture"And apparently this line of code is the culprit:PHP Code:[code]if (($_FILES['picture']['size'] != 0) && ($_FILES['picture']['tmp_name'] != ''))[/code]I just can't figure out why this works perfectly on my PC, but causes an error on my BlackBerry. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/14222-different-behavior-between-desktop-and-blackberry/ Share on other sites More sharing options...
redarrow Posted July 10, 2006 Share Posted July 10, 2006 if (($_FILES['picture']['size'] != 0) && ($_FILES['picture']['tmp_name'] != ''))try somthink like that ok.if ((!$_FILES['picture']['size'] == 0) && (!$_FILES['picture']['tmp_name'] == 0 '')) Quote Link to comment https://forums.phpfreaks.com/topic/14222-different-behavior-between-desktop-and-blackberry/#findComment-55812 Share on other sites More sharing options...
ShogunWarrior Posted July 10, 2006 Share Posted July 10, 2006 Try doing a [b]print_r[/b] on the [b]$_FILES[/b] array to see what's in it. Maybe it's sending the form variables differently. Quote Link to comment https://forums.phpfreaks.com/topic/14222-different-behavior-between-desktop-and-blackberry/#findComment-55814 Share on other sites More sharing options...
hadoob024 Posted July 11, 2006 Author Share Posted July 11, 2006 Good call! I think the BlackBerry just doesn't send $_POST stuff properly. Like if a field isn't filled out, I think it might just not be adding it to the $_POST array (instead of just assigning a NULL value). I added(isset($_FILES['picture'])) to my "if" statement, and this solved the problem! Sweet! It works on the BlackBerry now. Thanks everyone!!! Quote Link to comment https://forums.phpfreaks.com/topic/14222-different-behavior-between-desktop-and-blackberry/#findComment-55941 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.