PHP Classes

File: demo1.php

Recommend this page to a friend!
  Classes of Grigori Kochanov   gCurl   demo1.php   Download  
File: demo1.php
Role: Example script
Content type: text/plain
Description: Simpliest demo of pagckage use
Class: gCurl
Perform HTTP requests using Curl
Author: By
Last change: Accessible without user login
Date: 16 years ago
Size: 446 bytes
 

Contents

Class file image Download
<?php
/**
 * Basic demo : receive and output the content of a remote site
 */
//Include library
require_once('gCurl/gcurl.class.php');

try{
   
//initialize the class
   
$curl = new gCurl('http://www.google.com/');
   
   
//show the content received
   
echo $curl->exec();
}catch (
gksException $E){
   
$message = $E->getLogMessage();
   
file_put_contents('gcurl.error_log.txt',$message);
    echo
$E->getHtmlMessage();
}