lucky678 Posted June 11, 2013 Share Posted June 11, 2013 (edited) <?php $users = array( '111111' => '1111111', '22222' => '22222', '3333' => '333332', '44444' => '4444', '5555' => '555' ); foreach($users as $username => $password) { //Execute same block of code for each username/password } $post_data = "$user=$username&$pass=$password&RememberMe=1&submit2=LOGIN"; $cookie = tempnam("/coki", "CURLCOOKIE"); $i = 0; while($i != 5) { $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"http://www.unknown.com/login.asp"); curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*")); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); $ct = curl_exec( $ch ) print $ct; $i++; } ?> i am try to make 5 users to log in....but my code prosesed only 1 user (5555). Edited June 11, 2013 by lucky678 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.