Jump to content


Photo

Different behavior between desktop and BlackBerry


  • Please log in to reply
3 replies to this topic

#1 hadoob024

hadoob024
  • Members
  • PipPipPip
  • Advanced Member
  • 192 posts

Posted 10 July 2006 - 08:34 PM

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:
if (($_FILES['picture']['size'] != 0) && ($_FILES['picture']['tmp_name'] != ''))



I just can't figure out why this works perfectly on my PC, but causes an error on my BlackBerry. Any thoughts?

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 July 2006 - 08:40 PM

if (($_FILES['picture']['size'] != 0) && ($_FILES['picture']['tmp_name'] != ''))

try somthink like that ok.

if ((!$_FILES['picture']['size'] == 0) && (!$_FILES['picture']['tmp_name'] == 0 ''))
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 10 July 2006 - 08:43 PM

Try doing a print_r on the $_FILES array to see what's in it. Maybe it's sending the form variables differently.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#4 hadoob024

hadoob024
  • Members
  • PipPipPip
  • Advanced Member
  • 192 posts

Posted 11 July 2006 - 01:17 AM

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!!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users