Re: Getting data from a web page



Hello,

on 01/30/2008 06:34 PM laredotornado@xxxxxxxxxxx said the following:
I'm using php 4.4.4. What I want to do is hopefully simple. If I
type this URL into my browser:

http://maps.google.com/maps/geo?q=980+PEMART+AVE+PEEKSKILL,+NY+10566&output=csv&;

key=ABQIAAAAuHEWowxYzDRtZwy5bJee6RRepaxJ09NBCcZ4ddHPnTvG1CBwlxTqGOXX0DHtp5WHcsP7cJ-K0vvurg

I get a simple comma-delimited list of data. What I would like to do
is in my PHP script, request this URL and then put the return values
into an array. How do I do this?

For simple requests like that, you can just call:

$csv = file_get_contents('http://maps.google.com/maps/geo?
q=980+PEMART+AVE+PEEKSKILL,+NY+10566&output=csv
&key=ABQIAAAAuHEWowxYzDRtZwy5bJee6RRepaxJ09NBCcZ4ddHPnTvG1CBwlxTqGOXX0DHtp5WHcsP7cJ-K0vvurg');


--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
.



Relevant Pages

  • Re: Free PHP 1 to 1 chat program
    ... >> PHP can only send a response back to the web browser in answer to a ... >> from the browser. ... This is not a limitation of PHP, ... environment on each request. ...
    (comp.lang.php)
  • Re: XmlHttpRequest not loading latest version of xml
    ... >> browser and re-open the browser. ... handle as a cacherequest) and a reasonable expiration date in the ... Either this way or the simpler one: Neither in ASP nor in PHP it is ... required HTTP headers can be included right into the resource requested, ...
    (comp.lang.javascript)
  • Re: Securing an Email script
    ... request to our sales office. ... Since you do ZERO checking on the values it's nothing BUT security ... very powerful PHP function to validate form fields and other ...
    (comp.lang.php)
  • Re: Large File Not Being Sent To Client
    ... On 2007-03-11 13:34, Jerry Stuckle wrote: ... I tried changing the php script to do fopen, fread, echo, ... Without the header the browser is free to figure on it's own how long the data should be. ...
    (comp.lang.php)
  • Re: Is this doable?
    ... it looks like your PHP code needs to submit another http request to the ... > access to other than as a user via the login form on a web page. ... > But then my question is how does the PHP handling page pass the correct ... > and put that in a PHP script which would log into the original db. ...
    (comp.lang.php)