Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://clean-machine.com.au/login.php');
- curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.107 Chrome/32.0.1700.107 Safari/537.36');
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "xid_59e5f=aa703d64fe1c8fb62efe0029daa878f9&is_remember=Y&mode=login&username=dipacci&password=dipacci");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_COOKIESESSION, true);
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-name'); //could be empty, but cause problems on some hosts
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); //could be empty, but cause problems on some hosts
- $answer = curl_exec($ch);
- if (curl_error($ch)) {
- echo curl_error($ch);
- }
- //another request preserving the session
- curl_setopt($ch, CURLOPT_URL, 'http://clean-machine.com.au/home.php');
- curl_setopt($ch, CURLOPT_POST, false);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "");
- $answer = curl_exec($ch);
- echo $answer;
- if (curl_error($ch)) {
- echo curl_error($ch);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement