php equivalent to asp's xmlhttp

Discussion in 'PHP' started by CommuniTriper, Dec 6, 2008.

  1. #1
    Hi

    In asp I used to call scripts in an asynchronous way by creating xmlhttp object and calling an external script with some variables like this:

    
    set xmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
    xmlHttp.open "POST", "http://www.test.com/test.asp?keyword=" &Keyword & "&offset=" & Offset & "&links=" & Links, false
    xmlHttp.send
    
    Code (markup):
    (the false means that this is an asnyc. call and the script doesn't wait for a response)

    I'm looking to do the same with PHP

    Its important that the script will be executed but would not affect the runtime of the originating script since it's dependent on other server to execute sometimes a heavy procedure or sometimes script b's server might be non responsive at all, the user should not be affected but still script a should trigger this call (to script b) not a cron job or any other automation of that sort, also not a javascript, I don't want to expose script b's location to the client side.

    hope I was coherent, its my first post here and english is not my native language.

    Thanks!
     
    CommuniTriper, Dec 6, 2008 IP
  2. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #2
    XMLHttpRequest is DOM Object. Web Browser handle this not PHP or ASP. You can use same object in PHP.
     
    greatlogix, Dec 6, 2008 IP
  3. CommuniTriper

    CommuniTriper Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for replying

    looking at my code again, the object is called msxml and it is an object I used with ASP

    (Server.CreateObject("Msxml2.ServerXMLHTTP"))

    to send offline/async xmlhttp requests from an asp script.

    if we ignore the msxml/xmlhttp thing, is there anything in php that can give me that feature i'm looking for?
     
    CommuniTriper, Dec 6, 2008 IP