Hi, The problem is that GET passes the query parameters in the URL, while POST passes them in the body of the request. In a GET request, getQueryString() would return "some=parameter&another=parameter" given that the accessed URL was "/some/path?some=parameter&another=parameter". In POST, getQueryString() would return "" (or null) given that the accessed URL was "/some/path" and the parameters were specified in the body. Generally speaking, getQueryString() is more or less of a hack that directly gives you the query string (that comes after the path) so that you can append something to it and pass it along... The best approach (be it GET or POST) is to handle the actual request parameters individually and not the query string. Do this using either getParameterMap() or the pair getParameterNames(), getParameterValues(String parameterName). Cheers, Eduard On 05/19/2011 12:50 AM, China Sunrise wrote:
Hi, My xwiki 3.0 implementation is using PHP in many pages, and some pages are based on simple HTML forms with a "submit" button. In the PHP part, I process $request->getQueryString() to check the form fields that were sent. It works very well when the form used the GET method, but doesn't work at all when the form used the POST method. Doing some research, it looks like the getQueryString() method should handle both scenarios but it doesn't, so I wonder if there is anything else blocking the POST data at a lower level.
I also did the same test not inside PHP and run into the same issue, so it does not look to be PHP-related.
Unfortunately this is becoming critical as GET data size is limited and I start running into this limit on some forms, so have to move to POST.
Thanks _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users