kıvırmak kullanarak bir sitede oturum

0 Cevap php

Ben Kıvrılmaları kullanarak ve sonra sayfa sonuçlanan olsun bir site loginto istiyorum. Örneğin ben bir komut dosyası çalıştırmak ve benim yahoo mail sayfasını görmek istiyorum. Ben böyle bir şey yazdı.

//set POST variables
$url = 'http://localhost/test/login';
$fields = array(
                        'username'=>'abc',
                        'password'=>'def'
                );
$fields_string='';
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);
echo $result;

login.php

echo $_POST['username'];
echo $_POST['password'];

header('Location: http://www.xyz.com/');

login.php ama xyz.com içeriğine komut mesaj veriler gösterilmemiştir.

0 Cevap