Formularz jest następujący:
<form action="http://iitv.info/ogladaj/" method="POST"> <input type="hidden" name="og_ser" value="100-questions" /> <input type="hidden" name="og_s" value="1" /> <input type="hidden" name="og_e" value="1" /> <input type="hidden" name="og_url" value="what-brought-you-here" /> <input type="hidden" name="og_code" value="8e5abe9f50a7a1f1c81c6a05cd065ea2" /> <input type="submit" /> </form>
Mój kod php:
$c = curl_init(); curl_setopt($c, CURLOPT_URL, 'http://iitv.info/ogladaj/'); curl_setopt($c, CURLOPT_POST, 1); curl_setopt($c, CURLOPT_POSTFIELDS, 'og_ser=100-questions&og_s=1&og_e=1&og_url=what-brought-you-here&og_code=8e5abe9f50a7a1f1c81c6a05cd065ea2'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_REFERER, 'http://iitv.info/100-questions/s01e01-what-brought-you-here.html'); curl_setopt($c, CURLOPT_COOKIEFILE, 'cookies.txt'); curl_setopt($c, CURLOPT_COOKIEJAR,'cookies.txt'); curl_setopt($c, CURLOPT_TIMEOUT, 30); curl_setopt($c, CURLOPT_HEADER, 0); $page = curl_exec($c); curl_close($c);