PHP Classes
Icontem

File: demo1.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Grigori Kochanov  >  gCurl  >  demo1.php  
File: demo1.php
Role: Example script
Content type: text/plain
Description: Simpliest demo of pagckage use
Class: gCurl
Perform HTTP requests using Curl
 

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();
}

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products