Jump to content

plz help with explode.


ShivaGupta
Go to solution Solved by ShivaGupta,

Recommended Posts

i have a text file that contant user name n pass in this format.

 

 

 

user111111,pass
1111111111,1111
2222222222,2222
3333333333,3333
4444444444,4444
5555555555,5555
6666666666,6666
7777777777,7777
8888888888,8888
9999999999,9999

 

(or suggest  me beter format for post data frm text file)

 

 

 

and i have this curl that working with "while" loop

$i = 0;
while($i != 50) {
  // Your code here
  $i++;
}
<?php

$username ="8888888";
$password ="2417978";
$tomob ="888888888";
$myFile22 = "xxxxxx.txt";
$fh2 = fopen($myFile22, 'r');
$theData22 = fread($fh2, filesize($myFile22));
fclose($fh2);


$raman = explode(';',$theData22);


      function randomstring() {
      $characters = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
      $param=rand(5,strlen($characters) - 1);
      $random_string_length = $param;
      $string = '';
        for ($i = 0; $i < $random_string_length; $i++) {
      $string .= $characters[rand(0, strlen($characters) - 1)];
      }
        return ($string);
   }

$i = 0;
while($i != 9) {

$c = $_REQUEST['recaptcha_challenge_field'];
$cv = $_REQUEST['recaptcha_response_field'];
$cookie = tempnam("/tmp", "CURLCOOKIE");

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,"http://example.com");
curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_REFERER,"http://example.com");
$one=curl_exec($ch);

preg_match("/input name=\"(.*?)\" type=\"text\" class=\"existing_user round_four\" id=/i",$one,$matches);
$user = $matches[1];

preg_match("/input name=\"(.*?)\" type=\"password\" class=\"existing_user round_four\" id=/i",$one,$matches);
$pass = $matches[1];

$post_data = "$user=$username&$pass=$password&RememberMe=1&submit2=LOGIN HERE";
$url = "http://example.com";
$cookie = tempnam ("/tmp", "CURLCOOKIE");
$ch = curl_init();
curl_setopt( $ch, CURLOPT_USERAGENT,"User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0" );
curl_setopt( $ch, CURLOPT_URL, $url );
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 );

if(stristr($ct,"number & password"))


{
echo "<font color='red'><b>Invalid mobile number / password. Try Again With Correct Details.</b></font>";
}
else
{

if(stristr($ct,"xxxxx.php"))
{

{
echo "<b><font color=red>ccccccccccccccccccc.</font></b><br>";
}
$i++;
}

?>


so here what i want.

 

 

first explode username and pass frm text file then intrigret  with whil loop  for post data @ $username ="8888888";
                                                                                                                                           $password ="2417978";

 

 

 

so can u help me with a example how to do that multi user login with 1 script.

.

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • 2 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.