TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
curl Class Reference

Titan CURL Class. More...

Public Member Functions

 __construct ($url= '', $referer= '', $username= '', $password= '')
 
 upload ($filename, $url= '', $referer= '', $username= '', $password= '')
 
 post (&$fields, $url= '', $referer= '', $username= '', $password= '', $upload=false, $erasecookies=false)
 
 get ($url= '', $referer= '', $username= '', $password= '', $erasecookies=false)
 
 get_cookie ($var)
 
 set_cookie ($var, $val)
 

Detailed Description

Titan CURL Class.

Class: \tl\io\curl

Author
James E. Bush work@.nosp@m.bush.nosp@m..cc
Version
5.1.0

Example 1:

$curl = new curl();
$response = $curl->get('http://www.domain.com/');

Example 2:

$curl = new curl();
$curl->cookie('user', 'web_username');
$curl->cookie('pass', 'web_password');
$response = $curl->get('https://secure.domain.com/some.php', 'http://www.domain.com/referrer.aspx', 'httpd_username', 'httpd_passwd');

Constructor & Destructor Documentation

__construct (   $url = '',
  $referer = '',
  $username = '',
  $password = '' 
)

Constructor

Parameters
string$url(optional) Preset URL (default) ''
string$referer(optional) referrer, if needed (default) ''
string$username(optional) username, if needed (default) ''
string$password(optional) password, if needed (default) ''

Member Function Documentation

upload (   $filename,
  $url = '',
  $referer = '',
  $username = '',
  $password = '' 
)

Upload a file

Parameters
string$filenamePath to existing file to upload
string$url(optional) URL to upload file (default) '' = reuse last URL
string$referer(optional) referrer, if needed (default) ''
string$username(optional) username, if needed (default) ''
string$password(optional) password, if needed (default) ''
Returns
string The web content (result)
post ( $fields,
  $url = '',
  $referer = '',
  $username = '',
  $password = '',
  $upload = false,
  $erasecookies = false 
)

Post form data

Parameters
array$fieldsthe form data to post
string$url(optional) URL to POST (default) '' = reuse last URL
string$referer(optional) referrer, if needed (default) ''
string$username(optional) username, if needed (default) ''
string$password(optional) password, if needed (default) ''
boolean$upload(optional) Is this an upload? (default) false
boolean$erasecookies(optional) Should cookies be erased before POST? (default) false
Returns
string The web content (result)
get (   $url = '',
  $referer = '',
  $username = '',
  $password = '',
  $erasecookies = false 
)

Get web content

Parameters
string$url(optional) URL to GET (default) '' = reuse last URL
string$referer(optional) referrer, if needed (default) ''
string$username(optional) username, if needed (default) ''
string$password(optional) password, if needed (default) ''
boolean$erasecookies(optional) Should cookies be erased before POST? (default) false
Returns
string The web content
get_cookie (   $var)

Get a curl-saved cookie value

Parameters
string$varCookie name
Returns
mixed Cookie value (may be empty) or NULL if not set
set_cookie (   $var,
  $val 
)

Set a cookie for curl

Parameters
string$varCookie name
string$valCookie value

The documentation for this class was generated from the following file: