Jump to content

multi login failed in curl


lucky678

Recommended Posts

<?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).

Link to comment
https://forums.phpfreaks.com/topic/279044-multi-login-failed-in-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.