Ajax Pagination messed online, working offline on Firefox

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
itpvision
Forum Newbie
Posts: 5
Joined: Fri Jun 20, 2008 5:03 am

Ajax Pagination messed online, working offline on Firefox

Post by itpvision »

Hello,

I have implemented paging on Mysql Records with PHP, all works fine offline, while online it produces a huge error on Mozilla Firefox
Error:
ERROR
The requested URL could not be retrieved

While trying to process the request:

POST /prod_ajax.php?page=5 HTTP/1.1Host: http://www.vijewellery.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.vijewellery.com/prod.php
Cookie: PHPSESSID=8caa6us3ovb0viqrrp5fj70uv1
Pragma: no-cache
Cache-Control: no-cache
The following error was encountered:
* Invalid Request
Some aspect of the HTTP Request is invalid. Possible problems:
* Missing or unknown request method
* Missing URL
* Missing HTTP Identifier (HTTP/1.0)
* Request is too large
* Content-Length missing for POST or PUT requests
* Illegal character in hostname; underscores are not allowed

Your cache administrator is webmaster.

My Code:
prod.php
function Submit_To_Ajax(page) {
xmlHttp = AjaxHttpObject();
if (xmlHttp==null) {
alert("Your browser does not support AJAX !!!");
return;
}
xmlHttp.onreadystatechange=StateChanged;
xmlHttp.open("POST", page, true);
xmlHttp.send(null);
}
function StateChanged() {
if (xmlHttp.readyState == 4) {
document.getElementById('AjaxDiv').innerHTML=xmlHttp.responseText;
}
else {
document.getElementById('AjaxDiv').innerHTML='<img src="images/loading_circles.gif" width="30" height="30">';
}
}
prod_ajax.php
echo " <a href=\"javascript:Submit_To_Ajax('prod_ajax.php?page=$i$query$query2')\" class = \"pagin\"
onclick=\"Submit_To_Ajax('prod_ajax.php?page=$i$query$query2')\">$i</a> " ;

Help APPRECIATED
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Ajax Pagination messed online, working offline on Firefox

Post by Christopher »

What the difference between prod.php and prod_ajax.php?
(#10850)
Post Reply