Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function curlfile($url, $url2){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=логинpassword=пассlogin=submit');
- curl_setopt($ch, CURLOPT_URL, $url2);
- $data = curl_exec($ch);
- #if(preg_match('#Location: ([S]+)#',$data,$rr)){$preg = $rr[1];} else {die('error c1');}
- curl_close($ch);
- return $data;
- }
- var_dump(curlfile('https://dxp.ru/takelogin.php', 'https://dxp.ru/index.php'));
Add Comment
Please, Sign In to add comment