Recommend this page to a friend! |
Download .zip |
Info | View files (5) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2009-07-03 (7 years ago) | 64% | Total: 1,092 | All time: 3,309 This week: 1,068 |
Version | License | PHP version | Categories | |||
phpwebhacks 1.5 | GNU General Publi... | 5 | HTML, HTTP, PHP 5 |
Description | Author | |||||||||||||
This class can be used to automate retrieval and processing of Web pages. |
|
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 - me@nashruddin.com License: GPL Website: http://php-http.com 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 http://php-http.com/documentation for more details. Example ======= This is a simple example to fetch a web page: <?php include 'phpWebHacks.php'; $h = new phpWebHacks; $page = $h->get('http://google.com/search?q=php+http'); ?> See more examples at http://php-http.com/examples. Contacts ======== Send comments, suggestions, and bug reports to me@nashruddin.com. |
Files |
File | Role | Description |
---|---|---|
README.txt | Doc. | Quick introduction |
phpWebHacks.php | Class | HTTP client |
example_1.php | Example | Send mail using GMail web application |
example_2.php | Example | Upload images to TinyPic.com and retrieve the URLs |
headers.txt | Data | Sample log file |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Documentation Class' documentation |
Examples HTTP scripting examples |
HTTP scripting with PHP Main site |
Pages that reference this package |
phpWebHacks - "HTTP Client" class in PHP (German) From time to time it may happen that you can download forms in PHP example from a different server, fill out and send back will. While this is relatively easily possible, but also relatively more labor (depending on the form)... |