Sending an HTTP request and reading the response

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cyber0ne

    Sending an HTTP request and reading the response

    I'm a bit new to PHP. One thing I'm trying to do right now is send an
    HTTP request and read the response in the code. For an example of what
    I'm talking about, see this:



    Would someone be able to show me a quick example of how to do this in
    my PHP code? I have a page that gets the "address" value posted to it
    from a form. Now I need to pass that value to the HTTP request and
    read back the response. Then I'll need that response in the form of a
    $latitude value and a $longitude value.

    Any help would be much appreciated. Thank you.

  • Chung Leong

    #2
    Re: Sending an HTTP request and reading the response

    cyber0ne wrote:
    I'm a bit new to PHP. One thing I'm trying to do right now is send an
    HTTP request and read the response in the code. For an example of what
    I'm talking about, see this:
    >

    >
    Would someone be able to show me a quick example of how to do this in
    my PHP code? I have a page that gets the "address" value posted to it
    from a form. Now I need to pass that value to the HTTP request and
    read back the response. Then I'll need that response in the form of a
    $latitude value and a $longitude value.
    >
    Any help would be much appreciated. Thank you.
    $contents = file_get_conten ts($url);

    Quick enough?

    Comment

    Working...