Connecting Tech Pros Worldwide Help | Site Map

Sending an HTTP request and reading the response

  #1  
Old August 7th, 2006, 06:25 PM
cyber0ne
Guest
 
Posts: n/a
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:

http://www.google.com/apis/maps/docu...g_HTTP_Request

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.

  #2  
Old August 7th, 2006, 06:35 PM
Chung Leong
Guest
 
Posts: n/a

re: Sending an HTTP request and reading the response


cyber0ne wrote:
Quote:
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:
>
http://www.google.com/apis/maps/docu...g_HTTP_Request
>
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_contents($url);

Quick enough?

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help! Can not read environment variables from server on http request to a html page. Shashank answers 1 March 19th, 2007 02:15 PM
sending http requests with curl but closing before reading the response yawnmoth answers 4 July 27th, 2006 08:15 PM
TCPClient in HTTp Request jin answers 15 November 17th, 2005 06:26 AM
HTTP Webserver - tcp thread issues Microsoft News answers 6 November 15th, 2005 06:30 PM