Menu

#1 fixed treatment of array-like input in POST FORMS

open-fixed
nobody
None
5
2005-07-07
2005-04-21
Anonymous
No

Hello,

I like your script very much - I started to do something
like this, but then I found your solution. Unfortunately it
gave me an error in my FORMs. But not in every. I
found, that it is the array-like usage of e.g.
<input name="ids[]" value=2...
<input name="ids[]" value=12...
Below is my solution:

//Timo Damm --- privat@timp-damm.de ---
//now array-like input in POST-FORMS a la ids[] are
handled correctly!!!
//21.04.2005
if (is_array($values[Key($values)])) {
$tmpbuf = "";
foreach($values[Key($values)] as $v) {
$tmpbuf .= Key($values)."[]=".UrlEncode($v)."&";
}
$this->request_body.=substr($tmpbuf,0,-1);
} else {
$this->request_body.=Key($values)."="
.UrlEncode($values[Key($values)]);
}
}

It needs to be inserted in Function SendRequest (File
http.php around line 480 (version 2.1) after:

"if($value>0) $this->request_body.="&";

Greetings

Discussion

  • stephen yabziz

    stephen yabziz - 2005-07-07

    Logged In: YES
    user_id=1038158

    Thanks for your report!
    I have fixed it in next version,also fixed this problem on
    $_GET!

     
  • stephen yabziz

    stephen yabziz - 2005-07-07
    • status: open --> open-fixed
     

Log in to post a comment.