Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
// php -q fetchPage.php http://www.example.com
4
//
5
// Fetches the URL passed to the constructor and echoes it out.
6
 
7
require_once('Net/Curl.php');
8
 
9
$curl = & new Net_Curl($argv[1]);
10
$result = $curl->create();
11
if (!PEAR::isError($result)) {
12
 
13
    // Set other options here with Net_Curl::setOption()
14
 
15
    $result = $curl->execute();
16
    if (!PEAR::isError($result)) {
17
        echo $result."\n";
18
    } else {
19
        echo $result->getMessage()."\n";
20
    }
21
 
22
    $curl->close();
23
} else {
24
    echo $result->getMessage()."\n";
25
}
26
 
27
?>