Weird $_POST behaviour

Discussion in 'PHP' started by logondotinfo, Apr 14, 2009.

  1. #1
    Hi - I have a piece of code which is working on in excess of 2000 sites, on wildly different server configurations with no errors. Today, I install it on a server which appears to have all the same phpinfo() settings, and I have hit a roadblock. I have never encountered this behaviour before and cant find ANYTHING online to explain it.

    Basically, this is a very simple php file with a multipart form in it.

    The for generates text fields with anested array of post values:
    name[1], name[2], name[3] etc etc

    These are sent by a post form, and on the following screen the $_POST values are captured and enetred into the database with the numeric indicator referencing a language setting. This, as I have mentioned has always worked without fail.

    So this new server had blank $_POST array, and after a huge amount of digging and playing, I have found that if I change the values to:
    name(1), name(2), name(3) etc etc

    it all works. However there are over 500 file sin this software suite, the vast majority fo which have the same kind of post form setup, and I really could do without going manually through each and every one to correct this output bug.

    So; my questions:
    1a) Anybody ever see this behaviour before
    1b) if so, any idea what causes it
    2) Any idea how to solve it - php.ini setting or similar??
    3) Or a clever little php function I can wrap my forms in which will convert name[1] to name(1)

    Any help greatly appreciated, I am rapidly going bald with this one lol.
     
    logondotinfo, Apr 14, 2009 IP
  2. logondotinfo

    logondotinfo Peon

    Messages:
    314
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if it helps...

    php version: 5.1.6
    cant see if suhosin is running, i am assuming not
    also causes failure of uploads and checkbox fields - basically anything which is not a simply labelled value in the posted form.
     
    logondotinfo, Apr 14, 2009 IP
  3. logondotinfo

    logondotinfo Peon

    Messages:
    314
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #3
    well, for anybody who googles at a later date with this issue, it is annoyingly mundane - the fix was right in front of me, and given the information i put above nobody could have fixed it, as the issue I hadnt even thought to detail.

    I was viewing the site via a plesk preview, using port 8443. Apparently this blocks certain $_POST functions. Changing to viewing on a static IP resolved everything.

    Go figure....
     
    logondotinfo, Apr 14, 2009 IP
  4. rickyray

    rickyray Peon

    Messages:
    65
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well thanks for posting your response, who would have even guessed!
     
    rickyray, Apr 14, 2009 IP
  5. NateJ

    NateJ Active Member

    Messages:
    240
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #5
    I've had a similar problem before, I ended up editting all of the scripts as it seemed the only way i could make it work.
     
    NateJ, Apr 14, 2009 IP
  6. BoneJj

    BoneJj Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    what exactly is this software for, any link to what it is used for?

    I'm just curious on this as maybe it's something I might be interested in.

    Nice bit of info as well, I'll have to keep an eye out for this if I run into any problems...
     
    BoneJj, Apr 14, 2009 IP