cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: trouble with multiple KEY/VALUE pairs in URL

From: John Deck <jdeck_at_berkeley.edu>
Date: Tue, 20 Dec 2005 06:56:26 -0800

After, poking around a bit more i realized this was loading, but just
not visible on the page itself and i have to view source to see the
returned XML. This threw me because if I just call the URL i use
in Firefox it shows up on the screen without having to view source.
I'm guessing that turning the HEADERS off does this. But, if I turn
HEADERS on, all i get is a bunch of HEADER code and no results...
Anyway, I think i have something useful to work with now. If anybody
has a clue why the PHP script call doesn't return output directly to
the screen i'd like to know about it....

John

<?php
$url="http://olla.berkeley.edu:8080/dm/sal?
lat=37&lng=-120&layers=srtm30";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_exec($ch);
curl_close($ch);
?>

On Dec 19, 2005, at 1:27 PM, Daniel Stenberg wrote:

> On Mon, 19 Dec 2005, John Deck wrote:
>
>
>
>
>> Interestingly, if i enclose the URL in quotes, things work as
>> expected:
>>
>>
>>
>
> That's because your shell munges the command line otherwise due to
> the special letters you used in the URL. It has nothing to do with
> curl really.
>
>
>
>
>> I'd like to get this to work via PHP and tried putting extra
>> quotes in the URL string in PHP but that didn't work... Any clues??
>>
>>
>>
>
> PHP is not even similar to your shell.
>
> I think you should instead show us your PHP code and tell us what
> happens when you run it.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/
> curl.html
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-12-20