PHP Classes

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Joshua Gilman  >  HTTPSock  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: File testing the class
Class: HTTPSock
Send HTTP requests to a Web server using sockets
Author: By
Last change:
Date: 8 years ago
Size: 606 bytes


Class file image Download


$socket = new HTTPSock();

/* Simple GET */
echo $socket->HTTPRequest("GET", "");

/* Advanced POST, use array's for overwriting header values and using POST variables */
$header = array("Referer" => "");
$socket->HTTPRequest("POST", "", array("somevar" => "somevalue"), $header);

/* Returns the a cookie with the name 'somecookie' */
echo $socket->cookies['somecookie'];

/* Returns what the content was encoded in */
echo $socket->headers['Content-Encoding'];