Utilisateur:Amgine/basebot.php/login
/** * 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 ); }