ShivaGupta Posted June 22, 2013 Share Posted June 22, 2013 i have a text file that contant user name n pass in this format. user111111,pass1111111111,11112222222222,22223333333333,33334444444444,44445555555555,55556666666666,66667777777777,77778888888888,88889999999999,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 https://forums.phpfreaks.com/topic/279459-plz-help-with-explode/ Share on other sites More sharing options...
ShivaGupta Posted September 12, 2013 Author Share Posted September 12, 2013 solved...................... Link to comment https://forums.phpfreaks.com/topic/279459-plz-help-with-explode/#findComment-1449287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.