Login   Register  
PHP Classes
elePHPant
Icontem

File: test_basecamp.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Md Emran Hasan  >  HTTP client class  >  test_basecamp.php  >  Download  
File: test_basecamp.php
Role: Example script
Content type: text/plain
Description: Test file showing logging into basecamp.
Class: HTTP client class
Access Web resources via HTTP with sockets or Curl
Author: By
Last change:
Date: 2008-01-29 09:02
Size: 619 bytes
 

Contents

Class file image Download
<?php

// Include the Http Class
include_once('class.http.php');

// Instantiate it
$http = new Http();

// Let's not use cURL
$http->useCurl(false);

// POST method
$http->setMethod('POST');

// POST parameters
$http->addParam('user_name' 'yourusername');
$http->addParam('password'  'yourpassword');

// Referrer
$http->setReferrer('https://yourproject.projectpath.com/login');

// Get basecamp dashboard (HTTPS)
$http->execute('https://yourproject.projectpath.com/login/authenticate');

// Show result page or error if occurred
echo ($http->error) ? $http->error $http->result;

?>