Note that there are some explanatory texts on larger screens.

plurals
  1. POfopen(), sleep(2), fwrite(), fgets() returns false response (POST Request) PHP
    primarykey
    data
    text
    <p>I want to POST <code>$data</code> to <code>$url</code> after it has connected for 2 seconds. But it does not work. Where's the problem? Like this it returns the normal site.</p> <pre><code>//$url is set above to http://www.putlocker.com/file/CB79E6201EDBA3ED //$hash variable is set above in the code $post = fopen($url, "r"); if (!$post) die("Error\n"); $data = "hash=$hash&amp;confirm=Continue%20as%20Free%20User"; sleep(2); fwrite($post, "POST $url HTTP/1.1\r\n"); fwrite($post, "Referer: $url\r\n"); fwrite($post, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($post, "Host: www.putlocker.com"); fwrite($post, "Content-length: " . strlen($data) . "\r\n"); fwrite($post, "Accept: */*\r\n"); fwrite($post, "\r\n"); fwrite($post, "$data\r\n"); fwrite($post, "\r\n"); if ($post) { while (($buffer = fgets($post, 4096)) !== false) { echo $buffer; } if (!feof($post)) { echo "Error fgets()\n"; } } fclose($post); </code></pre> <p><strong>Here is my latest code:</strong></p> <pre><code>require_once('curll.php'); libxml_use_internal_errors(true); $url = "http://www.putlocker.com/file/CB79E6201EDBA3ED"; $curl = new curling(); $output = $curl-&gt;get_page($url); //call your landing page url from here $dom_document = new DOMDocument(); $dom_document-&gt;loadHTML($output); $dom_xpath = new DOMXPath($dom_document); foreach($dom_xpath-&gt;query("//input[@name=\"hash\"]/@value") as $node) $hash=$node-&gt;textContent; foreach($dom_xpath-&gt;query("//form/@action") as $node) $post_url=$node-&gt;textContent; sleep(2); $data = array('hash' =&gt; $hash, 'confirm' =&gt; 'Continue%20as%20Free%20User'); $output2 = $curl-&gt;post_page($post_url, $data); $curl-&gt;close_session(); echo $output2; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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