i am developing mobile application in cordova+angularJS in ionic framework. I am trying to send parameters in the get request body that is probably the request to get specific data based on input parameters. My query string is this:
var queryString = base_url + "get/requestChartData.php?userid=" + window.localStorage.userid + "&token=" + token + "&formid=" + formID + "&questionid=" + questionID + "&chart=" + chartType;
$http.get(queryString, {}).success(function (data, status, headers, config) {
.....
...
This request when i send to the server where PHP handles the request, send me back response as <b>Notice</b>: Undefined index: chart in....
and even on my firebug debugging console, on the get request link when i expand, it shows me only four parameters instead of five.
is there any limit of sending number of parameters in the get request as a query string???
at PHP side i am doing this:
$userid = trim($_REQUEST['userid']);
$formid = trim($_REQUEST['formid']);
$fieldName = trim($_REQUEST['questionid']);
$chartType = trim($_REQUEST['chart']);
$token = trim($_REQUEST['token']);
i am not getting this one any resolution to it????
Ok, it seems that some versions of PHP have a limitation of length of GET params:
Please note that PHP setups with the suhosin patch installed will have a default limit of 512 characters for get parameters. Although bad practice, most browsers (including IE) supports URLs up to around 2000 characters, while Apache has a default of 8000.
To add support for long parameters with suhosin, add
suhosin.get.max_value_length = <limit>
inphp.ini
Source: http://www.php.net/manual/en/reserved.variables.get.php#101469
Can you try the same with .post
?