Topic
  • 10 replies
  • Latest Post - ‏2015-04-30T12:00:29Z by Nicol
geoffcox
geoffcox
3 Posts

Pinned topic wny data not received by php file?

‏2011-10-16T12:27:29Z |
Hello

I have the following code. The values are not displayed by the php code. If I use the generated url on its own they are received!

What is wrong?!

Thanks

Geoff

function startRequest(url) {

createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function handleStateChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
}
}
}

startRequest("http://www.micro-active.com/music-events/members/music-events-right-ajax-version.php?searchfield=" + value + "&term=" + newdate);
Updated on 2012-05-10T07:57:22Z at 2012-05-10T07:57:22Z by dasdonna
  • geoffcox
    geoffcox
    3 Posts

    Re: wny data not received by php file?

    ‏2011-10-16T14:28:13Z  
    Hello

    I should have added that if I add

    alert("url = " + url);

    in

    function MakeRequest(url)
    {

    alert("url = " + url); etc

    and then copy the generated url into the browser the data does then go to the php file.

    What I cannot work out is why the code in the first message doesn't send it too ...

    Cheers

    Geoff
  • geoffcox
    geoffcox
    3 Posts

    Re: wny data not received by php file?

    ‏2011-10-16T14:29:37Z  
    • geoffcox
    • ‏2011-10-16T14:28:13Z
    Hello

    I should have added that if I add

    alert("url = " + url);

    in

    function MakeRequest(url)
    {

    alert("url = " + url); etc

    and then copy the generated url into the browser the data does then go to the php file.

    What I cannot work out is why the code in the first message doesn't send it too ...

    Cheers

    Geoff
    oops! the function is called

    startRequest not MakeRequest.

    Geoff
  • NiteshAhir
    NiteshAhir
    1 Post

    Re: wny data not received by php file?

    ‏2011-10-21T07:42:57Z  
    • geoffcox
    • ‏2011-10-16T14:28:13Z
    Hello

    I should have added that if I add

    alert("url = " + url);

    in

    function MakeRequest(url)
    {

    alert("url = " + url); etc

    and then copy the generated url into the browser the data does then go to the php file.

    What I cannot work out is why the code in the first message doesn't send it too ...

    Cheers

    Geoff
    Try below function

    function startRequest(url) {
    var http = false;
    if(navigator.appName == "Microsoft Internet Explorer") http = new ActiveXObject("Microsoft.XMLHTTP");
    else http = new XMLHttpRequest();
    http.abort();
    http.open("GET", url, true);
    http.onreadystatechange=function()
    {
    if(http.readyState == 4)
    {
    alert(http.responseText);
    }
    }
    http.send(null)
    }
    Nitesh Ahir
    PHP Developer | Web Development Company
  • SystemAdmin
    SystemAdmin
    1140 Posts

    Re: wny data not received by php file?

    ‏2011-10-24T01:01:07Z  
    Alternatively use some Ajax PHP library such as xajax.
  • dasdonna
    dasdonna
    2 Posts

    Re: wny data not received by php file?

    ‏2012-05-10T07:44:54Z  
    Alternatively use some Ajax PHP library such as xajax.
    404 is File Not Found. So, your requested URL is not available. Check is simpleResponse.xml accessible? if it is, try to use full URL: http://blablabla.com/simpleResponse.xml
    <url="http://www.prodigyapex.com/"]web development services[/url]
  • dasdonna
    dasdonna
    2 Posts

    Re: wny data not received by php file?

    ‏2012-05-10T07:57:22Z  
    • dasdonna
    • ‏2012-05-10T07:44:54Z
    404 is File Not Found. So, your requested URL is not available. Check is simpleResponse.xml accessible? if it is, try to use full URL: http://blablabla.com/simpleResponse.xml
    <url="http://www.prodigyapex.com/"]web development services[/url]
    404 is File Not Found. So, your requested URL is not available. Check is simpleResponse.xml accessible? if it is, try to use full URL: http://blablabla.com/simpleResponse.xml
    Link:web development services
  • jitupkp
    jitupkp
    104 Posts

    Re: wny data not received by php file?

    ‏2014-09-20T11:11:05Z  

    get more help

    http://techgurulab.com/course/ajax-quiz-online/

  • jitupkp
    jitupkp
    104 Posts

    Re: wny data not received by php file?

    ‏2014-09-20T11:11:18Z  
    • dasdonna
    • ‏2012-05-10T07:44:54Z
    404 is File Not Found. So, your requested URL is not available. Check is simpleResponse.xml accessible? if it is, try to use full URL: http://blablabla.com/simpleResponse.xml
    <url="http://www.prodigyapex.com/"]web development services[/url]

    get more help

    http://techgurulab.com/course/ajax-quiz-online/

  • jitupkp
    jitupkp
    104 Posts

    Re: wny data not received by php file?

    ‏2014-09-20T11:11:30Z  
    • dasdonna
    • ‏2012-05-10T07:57:22Z
    404 is File Not Found. So, your requested URL is not available. Check is simpleResponse.xml accessible? if it is, try to use full URL: http://blablabla.com/simpleResponse.xml
    Link:web development services

    get more help

    http://techgurulab.com/course/ajax-quiz-online/

  • Nicol
    Nicol
    1 Post

    Re: wny data not received by php file?

    ‏2015-04-30T12:00:29Z  

    I think you should debug the code by various online and offline software...May I know exact error? Can you share screenshot?

     

     

    Regards,

    Nick(Sr. Web Designer at DealsDaddy)