diff options
Diffstat (limited to 'php/examples')
-rw-r--r-- | php/examples/Makefile.am | 2 | ||||
-rw-r--r-- | php/examples/README | 19 | ||||
-rw-r--r-- | php/examples/getbinarypageinvar.php | 25 | ||||
-rw-r--r-- | php/examples/getpageinvar.php | 12 | ||||
-rw-r--r-- | php/examples/simpleget.php | 14 | ||||
-rw-r--r-- | php/examples/simplepost.php | 14 |
6 files changed, 0 insertions, 86 deletions
diff --git a/php/examples/Makefile.am b/php/examples/Makefile.am deleted file mode 100644 index 105a073ae..000000000 --- a/php/examples/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST = README getpageinvar.php getbinarypageinvar.php simpleget.php \ - simplepost.php diff --git a/php/examples/README b/php/examples/README deleted file mode 100644 index 975908d2d..000000000 --- a/php/examples/README +++ /dev/null @@ -1,19 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -PHP program examples - -getbinarypageinvar.php - - Fetch a single URL containing binary data and return it into a variable - -getpageinvar.php - - Fetch a single URL and return in a variable - -simpleget.php - - A very simple example that gets a HTTP page - -simplepost.php - - Example that sends a HTTP POST to a remote site diff --git a/php/examples/getbinarypageinvar.php b/php/examples/getbinarypageinvar.php deleted file mode 100644 index 52e542c3d..000000000 --- a/php/examples/getbinarypageinvar.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -// Allocate a new cURL handle -$ch = curl_init("http://www.designmultimedia.com/intro.jpg"); -if (! $ch) { - die( "Cannot allocate a new PHP-CURL handle" ); -} - -// We'll be returning this transfer, and the data is binary -// so we don't want to NULL terminate -curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); -curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); - -// Grab the jpg and save the contents in the $data variable -$data = curl_exec($ch); - -// close the connection -curl_close($ch); - -// Set the header to type image/jpeg, since that's what we're -// displaying -header("Content-type: image/jpeg"); - -// Output the image -print( $data ); -?> diff --git a/php/examples/getpageinvar.php b/php/examples/getpageinvar.php deleted file mode 100644 index 9b45d9ef7..000000000 --- a/php/examples/getpageinvar.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -// -// The PHP curl module supports the received page to be returned in a variable -// if told. -// -$ch = curl_init(); - -curl_setopt($ch, CURLOPT_URL,"http://www.myurl.com/"); -curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); -$result=curl_exec ($ch); -curl_close ($ch); -?> diff --git a/php/examples/simpleget.php b/php/examples/simpleget.php deleted file mode 100644 index 0ae431315..000000000 --- a/php/examples/simpleget.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -// -// A very simple example that gets a HTTP page. -// - -$ch = curl_init(); - -curl_setopt ($ch, CURLOPT_URL, "http://www.zend.com/"); -curl_setopt ($ch, CURLOPT_HEADER, 0); - -curl_exec ($ch); - -curl_close ($ch); -?> diff --git a/php/examples/simplepost.php b/php/examples/simplepost.php deleted file mode 100644 index 1c29447ba..000000000 --- a/php/examples/simplepost.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -// -// A very simple PHP example that sends a HTTP POST to a remote site -// - -$ch = curl_init(); - -curl_setopt($ch, CURLOPT_URL,"http://www.mysite.com/tester.phtml"); -curl_setopt($ch, CURLOPT_POST, 1); -curl_setopt($ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3"); - -curl_exec ($ch); -curl_close ($ch); -?> |