php url http pikabu ru login php if curl curl_init curl_setopt curl CU

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php
$url="http://pikabu.ru/login.php";
if($curl = curl_init()){
curl_setopt($curl,CURLOPT_URL, $url);
$data['enter_type'] = "simple";
$data['remember'] = "1";
$data['username'] = "login";
$data['password'] = "pass";
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$out = curl_exec($curl);
echo $out;
print_r($data);
curl_close($curl);
}