1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
$post = array(
'connexion_1' => "hjfghjghj",
'connexion_2' => "fgjhfgjfghj",
'connexion_3' => "fghjfgjhghj",
'connexion_4' => "fghjghjfgjh"
);
$ch = curl_init('http://lesite/verification_connexion');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$ret = curl_exec($ch);
if (!$ret) {
echo curl_error($ch);
} else {
$ch = curl_init('https://lesitesecurise/mesinfos');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
$ret2 = curl_exec($ch);
.....
traitement de $ret2 pour récupérer les infos
.....
}
curl_close($ch); |
Partager