« Utilisateur:Amgine/basebot.php/login » : différence entre les versions
Contenu supprimé Contenu ajouté
This worked for me. |
(Aucune différence)
|
Dernière version du 31 décembre 2009 à 20:42
/** * login method **/ function login( $mwUser, $mwPass, $mwSite ){ $ch = curl_init( $mwSite ); $postvars = array( 'action' => 'login', 'lgname' => $mwUser, 'lgpassword' => $mwPass, ); curl_setopt( $ch, CURLOPT_POST, true ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $postvars ); curl_setopt( $ch, CURLOPT_COOKIESESSION, true ); curl_setopt( $ch, CURLOPT_COOKIEJAR, 'cookies.txt' ); return curl_exec( $ch ); }