Hi Friends, I am using the listview with more than 5000 records. I am sending the IDs( integer field with more that 4 digits) via GET method. The problem is that there are more than 2000 or so records selected, i am getting the following error message. "Request - URI Too Large The requested URL's length exceeds the capacity limit for this erver. Request failed: URI too long and also i am getting the alert message that , "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete?". * How to solve the above problem . Is there any php setting is available for solving this issue?. It's Very Urgent requirement. Help me to solve this issue.
As I know GET method has a limitation of query length. I don't remember the exact number but it looks like you have reached it. Try to use POST method - it has higher limit.
I would agree with AsHinE, the POST method will be the correct way to do this. If that doesn't work, I would still use the POST method, but break up the page data to smaller chunks. I suspect processing a dataset this large will be a cause for a slow form post, thus a timeout. Perhaps setting the timeout of the script to be quite long or turned off would help as well. The issue here is the end user may hit refresh thinking something is wrong. If the processing is taking a long time, I would then suggest storing the POST variables into a temp file, then process the data off line. This would eliminate refreshes by the client and make things go a bit faster.
* Thanks for your reply. * I have changed the method to POST * Still, i am getting the javascript alert that "A script on this page may be busy, or it may have stopped responding. You canstop the script now, or you can continue to see if the script will complete?". * I am using the firefox version 2.0.0.3. I got some solution for solving this alert (ie) by setting the dom.max_script_run_time to 30 seconds in the URL about:config. * This works but it causes the user to set it every time in their browser. So, in the program itself, i need to set this variable value. If there any way to set dom.max_script_run_time in javascript?... Please Help me.......
Hi Had same problem and came up with the following solution: These two functions are used to serialize, compress and base64_encode the submitted array or string (I found the function at php.net): function encodeForURL ($stringArray) { $s = strtr(base64_encode(addslashes(gzcompress(serialize($stringArray),9))), '+/=', '-_,'); return $s; } function decodeFromURL ($stringArray) { $s = unserialize(gzuncompress(stripslashes(base64_decode(strtr($stringArray, '-_,', '+/='))))); return $s; } PHP: I submit the form using form method POST to an interim action page (e.g. action.php). From there I use the function encodeForURL ($_POST) as follows: $selectedClients = encodeForURL ($_POST); header('Location: ./?p=invoice&clientId='.$selectedClients); exit; PHP: On the page invoice I use the decode function as follows: $transferredArray = decodeFromURL ($_REQUEST['clientId']); PHP: And there you have it. But, this will only work for so long, until the submitted data grows too big (should keep it short). So if you trust your hosting provider, you can submit the data to the $_SESSION array. This is the solution I use today: On the action.php page do this: $_SESSION['cIdsTransfer'] = encodeForURL ($_POST); header('Location: ./?p=invoice'); PHP: And on invoice page I fetch the variable from the session instead of the URL like this: $transferredArray = decodeFromURL ($_SESSION['cIdsTransfer']); PHP: There's really no limit to the size of the string when storing it in the $_SESSION array (not taking time outs into account). On the serverside, if it is an array, it's serialized and stored in a temporary text file as a string. It's not an excuse for not trying to keep the submitted data to a minimum. Remember to include session_start(); at the pages where you need to fetch data from the $_SESSION array. Hope it's useful to somebody. Best regards Martin