CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Aug 2006
    Posts
    230

    XMLHttpRequest request to php page gives server 404 ( page not found)

    hello all
    im doing simple XMLHttpRequest request to the server tested both in apache 2.2 and
    lighttpd and they both gives me the same results
    i have client side code that lookes liks this
    index.php
    Code:
    var rqo;
    function req(d)
    {
       if (d != "")
       {
            document.getElementById("details_data").innerHTML = "Fetching Data ...." ;
            rqo = createRequestObject();
            var qry = encodeURIComponent(d);
            rqo.open('GET',qry,true); //<< also tried false here ... 
            rqo.onreadystatechange = handleDetailsHttpResponse ;      
            rqo.send(null);
    
            return false;
        }
    }
    
    function handleDetailsHttpResponse() {
      var results = "";
      if (rqo.readyState == 4) {
        results = rqo.responseText;
        document.getElementById("details_data").innerHTML = results;
      }
    }
    in the d variable the value is :
    index.php?Action=1&data_input=059652983X&data_category=All
    now in the lighttpd for example im getting the error that file is not found 404


    Code:
    2009-02-07 22:40:15: (response.c.453) -- logical -> physical 
    2009-02-07 22:40:15: (response.c.454) Doc-Root     : /var/www/ 
    2009-02-07 22:40:15: (response.c.455) Rel-Path     : /index.php?Action=1&data_input=059652983X&data_category=All 
    2009-02-07 22:40:15: (response.c.456) Path         : /var/www/index.php?Action=1&data_input=059652983X&data_category=All 
    2009-02-07 22:40:15: (response.c.473) -- handling physical path 
    2009-02-07 22:40:15: (response.c.474) Path         : /var/www/index.php?Action=1&data_input=059652983X&data_category=All 
    2009-02-07 22:40:15: (response.c.530) -- file not found 
    2009-02-07 22:40:15: (response.c.531) Path         : /var/www/index.php?Action=1&data_input=059652983X&data_category=All 
    2009-02-07 22:40:15: (response.c.116) Response-Header: 
    HTTP/1.1 404 Not Found
    Content-Type: text/html
    Content-Length: 345
    Date: Sat, 07 Feb 2009 20:40:15 GMT
    Server: lighttpd/1.4.19
    but the file is there for sure !!! this is the file im doing the request form ..
    can someone please explain me what im doing wrong ?
    Thanks
    Last edited by umen; February 7th, 2009 at 01:51 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured