Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use a class that I wrote that wraps around CURL. To install, see: <a href="https://github.com/homer6/altumo" rel="nofollow">https://github.com/homer6/altumo</a></p> <p>It's much easier to use and can give you some easy to access debugging. For example:</p> <pre><code>try{ //load class autoloader require_once( __DIR__ . '/loader.php' ); //you should ensure that is is the correct path for this file //make the response; return the response with the headers $client = new \Altumo\Http\OutgoingHttpRequest( 'http://www.domain.com/checkuser.php', array( 'username' =&gt; 'user', 'password' =&gt; 'pass', 'submit' =&gt; ' Login ' )); $client-&gt;setRequestMethod( \Altumo\Http\OutgoingHttpRequest::HTTP_METHOD_POST ); //send the request (with optional arguments for debugging) //the first true will return the response headers //the second true will turn on curl info so that it can be retrieved later $response = $client-&gt;send( true, true ); //output the response and curl info \Altumo\Utils\Debug::dump( $response, $client-&gt;getCurlInfo() ); //alternatively, you can get the response wrapped in an object that allows you to retrieve parts of the response $http_response = $client-&gt;sendAndGetResponseMessage( true ); $status_code = $http_response-&gt;getStatusCode(); $message_body = $http_response-&gt;getMessageBody(); $full_http_response = $http_response-&gt;getRawHttpResponse(); \Altumo\Utils\Debug::dump( $status_code, $message_body, $full_http_response ); }catch( \Exception $e ){ //This will display an error if any exceptions have been thrown echo 'Error: ' . $e-&gt;getMessage(); } </code></pre> <p>Hope that helps...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload