Advertisement
Guest User

Untitled

a guest
Mar 14th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. $testingURL = "https://www.testing.com?......";
  2. do {
  3. $lastData = "";
  4. curl_setopt($ch, CURLOPT_URL,$testingURL);
  5. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (AppleWebKit/537.3e/37.0.2062.124 Safari/537.36.....");
  6. curl_setopt($ch, CURLOPT_POST, 1);
  7. curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=testuser&password=testpwd');
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  10. curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
  11. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
  12. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers_curl);
  13. curl_setopt($ch, CURLOPT_REFERER, "www.test...com");
  14. $result = curl_exec($ch);
  15. // sleep(3);
  16. preg_match_all('/name="_checkkey".*?</td>/s',$result,$lastData);
  17. $lastData[1] = preg_replace('/[^a-zA-Z0-9_ %[].()%&-]/s', '', $lastData[1]);
  18. $testingURL = "https://www.testing.com?_chkKey=".$lastData[1][0]."&chiId=".$lastData[1][1];
  19.  
  20. } while (isset($lastData[1][1]) && $lastData[1][1] == "checkOneMoreTime");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement