Socket

Filepath: phork/php/utilities/Socket.class.php

The Socket class is used for automatic form posting and returning of the resulting page. This uses fsockopen() and is a good alternative for servers without the cURL extension.


Example

//post a form to http://www.example.org/foo/bar/ with $_POST['baz'] = 42 and print the output
if ($strOutput = Socket::postForm('/foo/bar/', array('baz' => 42), 'http://www.example.org')) {
    print $strOutput;
    exit;
}