Login   Register  
PHP Classes
elePHPant
Icontem

File: post_cached.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Schroetter Christian  >  PHP Curl HTTP Wrapper  >  post_cached.php  >  Download  
File: post_cached.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: PHP Curl HTTP Wrapper
Send HTTP requests with Curl and cache the results
Author: By
Last change:
Date: 6 months ago
Size: 558 bytes
 

Contents

Class file image Download
<?php
    
include('./curl.wrapper.php');

    
$curl = new CCurlWrapper();
    if(
$curl->InitEx() === false)
        die(
'Unable to init the CURL library' "\n");

    
// cache per month (the folder SHOULD have been created first)
    
$curl->EnableCache(trueCACHE_MONTH'./cache');

    
// POST parameters
    
$pp = array();
    
$pp['departement'] = '59';
    
$pp['option'] = 'com_agency';
    
$pp['task'] = 'findDepartement';
    
$pp['view'] = 'agency';
    
$curl->SetPOSTMode($pp);

    
// request
    
$content $curl->Exec('http://www.assurance-mutuelle-poitiers.fr/agent-mutuelle/coordonnees');

?>