473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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:

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.

Aug 7 '06 #1
1 1978
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:

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?

Aug 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Desmond Rivet | last post by:
Hi all, I will do an experiment on this soon, but if anyone knows off the top of their head... Let's say you have a servlet that processes a POST request. A HTTP client sends a POST request...
2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
2
by: Robert | last post by:
I'm new to XML. I need to have my asp.net page accept an XML document sent via HTTP (from a Java app), process some info and send back a response as XML. I continue to get back an error on my...
4
by: Maximus | last post by:
Hi everyone, I was wondering if anybody could help me with sending xml as part of an http post. Any help will be greatly appreciated. Thanks.
4
by: yawnmoth | last post by:
Is it possible to send http requests with curl but not have curl wait for the response? The reason I ask is because I'd like to code a web app that can sorta start time consuming processes...
2
by: barrybevel | last post by:
Hi, I have a very small simple program below which does the following: 1) post a username & password to a website - THIS WORKS 2) follow a link - THIS WORKS 3) update values of 2 fields and...
5
by: lanclot | last post by:
hi i am trying to authenticate a user using ClientLogin by sending a post to https://www.google.com/accounts/ClientLogin in my c program use ssl and socket the next code is my request:...
2
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.