PHP Classes

Hacker's HTTP Client: Automate retrieval and processing of Web pages

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 1,120 All time: 3,357 This week: 200Up
Version License PHP version Categories
phpwebhacks 1.5GNU General Publi...5HTML, HTTP, PHP 5


This class can be used to automate retrieval and processing of Web pages.

It can send HTTP GET, POST and HEAD requests to retrieve Web pages.

The class supports file uploads, HTTP authentication, HTTP and meta tag redirection and gzip compression.

It can also process the retrieved HTML pages to help extracting information to send subsequent requests like collecting cookies, extracting input values from forms, parsing meta tags.

Picture of Nashruddin Amin
Name: Nashruddin Amin <contact>
Classes: 1 package by
Country: Indonesia Indonesia
Age: 43
All time rank: 220830 in Indonesia Indonesia
Week rank: 578 Up8 in Indonesia Indonesia Up

phpWebHacks 1.5 =============== This is an advanced HTTP client written in PHP. It simulates a real web browser, only that you use it with lines of code rather than mouse and keyboard. Using pure PHP, no Curl or other fancy dependencies needed. The functionality makes it a perfect tool for HTTP scripting. Author: Nashruddin Amin - License: GPL Website: Features ======== * Support HTTP/1.1 * HEAD, GET, and POST * HTTPS * Cookies * Redirects * HTTP authentication * Proxy * Gzip encoding * log HTTP streams for full debugging * Parsing HTML forms * Custom User-Agent Documentation ============= * head($url) Make HTTP HEAD request to $url. Returns the response header in associative array. * get($url) Make HTTP GET request to $url. It will handle all redirects and returns the last HTML body. * post($url, $form=array(), $files=array()) Make HTTP POST request to $url. Returns the last HTML body. * parseForm($name_or_id, &$action, $html_string) Parse HTML forms and convert it to associative array. * setProxy($host, $port, $user='', $pass='') Set the proxy server to be used. * setDebug($is_debug) If is_debug is true, all HTTP streams will be logged. It's useful for debugging. * setInterval($second) Set the delay between requests. * setUserAgent($name) Assign a name to this HTTP client. It will appear in the 'User-Agent' field of the HTTP header. See for more details. Example ======= This is a simple example to fetch a web page: <?php include 'phpWebHacks.php'; $h = new phpWebHacks; $page = $h->get(''); ?> See more examples at Contacts ======== Send comments, suggestions, and bug reports to
  Files folder image Files  
File Role Description
Accessible without login Plain text file README.txt Doc. Quick introduction
Accessible without login Plain text file phpWebHacks.php Class HTTP client
Accessible without login Plain text file example_1.php Example Send mail using GMail web application
Accessible without login Plain text file example_2.php Example Upload images to and retrieve the URLs
Plain text file headers.txt Data Sample log file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:3,357
This week:200Up
 User Ratings  
 All time