Jump to content

Different behavior between desktop and BlackBerry


hadoob024

Recommended Posts

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?
Link to comment
Share on other sites

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!!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.