Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cookies = "cookie.txt"; // Make sure the file is created and had read/wright
- $ch = curl_init();
- $headers = array();
- $headers[] = 'Host: example.com';
- $headers[] = 'origin: http://example.com';
- $headers[] = 'authority: example.com';
- $headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36';
- $headers[] = 'Accept: */*';
- $headers[] = 'Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3';
- $headers[] = 'Accept-Encoding: gzip, deflate';
- $headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
- $headers[] = 'X-Requested-With: XMLHttpRequest';
- $headers[] = 'Connection: keep-alive';
- // we switch to new device
- $url = "http://example.com";
- $post_params = "user=hello&password=world";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_REFERER, $url);
- curl_setopt($ch, CURLOPT_COOKIESESSION, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
- curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
- curl_setopt($ch, CURLOPT_COOKIE, $cookies);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $dashboard = curl_exec($ch); // Will return the HTML od the page
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement