Jump to content

curl help..........plzzzzzzzzzzzzzz


Go to solution Solved by xenLiam,

Recommended Posts

i want to run    all curl in 50 time   .........plzzzzzzzzz tell how to set 50 time loop..........

 

 

 

 

 

 

 

<?php
set_time_limit(0);
$url = $_SERVER['HTTP_HOST'];
print"<title>xxxxx</title>
<div style='background:grey;padding:6px;color:white' align='center'><b>$url</b> -xxxxxxxxx</div> ";

$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);
   }


$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"))
{
$post_data2 = "captchaType=google&loginButton=LOGIN&recaptcha_challenge_field=$c&recaptcha_response_field=$cv";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);

if(!stristr($dt,xxxxx.php"))
{ die("<font color='red'><b>Invalid Captcha. Try Again.</b></font>");  }
}
$ff ="1";

for($loop=1;$loop<=$ff;$loop++)
{

$post_data2 = "";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);

preg_match('/name=\"qxci\" value=\"(.*?)\"/',$dt,$qxc);
$qxci = $qxc[1];
preg_match('/name=\"QuestionId\" value=\"(.*?)\"/',$dt,$qi);
$qid = $qi[1];
preg_match('/"ps_bg1">(.*?)</',$dt,$pk);
$ps = $pk[1];
preg_match('/"rs_bg1">(.*?)</',$dt,$rkk);
$rs = $rkk[1];
$sub = "1";

preg_match('/Question number:-(.*?)</',$dt,$aid);
$ansid = $aid[1];
$ansid2 = $ansid - $sub;

$ansit = $raman[$ansid2];
preg_match('/input type=\"text\" name=\"(.*?)\" id=\"(.*?)\" class=\"inputtxt\"   value=\"Type your answer here\"  style=\"border:0 none;\"/',$dt,$asninput);
$rasninput = $asninput[1];

$post_data3 = "qxci=$qxci&QuestionId=$qid&zxcoiesesscd=&$rasninput=$ansit";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data3);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$at = curl_exec($ch);


if(strstr($at,"xxx.ph"))
{
echo "<b><font color=green>".$ansid." xxxxxxxx.</font></b><br>";

echo "<b><font color=blue>Balance: ".$rs.".".$ps."</font></b><br>";

}
elseif(strstr($at,"xxxxx.ph"))
{
echo "<b><font color=magenta>xxxxxxxxxxxxxxxx.</font></b><br>";

}
else
{
echo "<b><font color=red>".$ansid." xxxxxxxxxxxx.</font></b><br>";
}
}
//rrrr ends


   $ff ="1";

         for($loop=1;$loop<=$ff;$loop++)
         {

$post_data2 = "";
   curl_setopt($ch, CURLOPT_URL,"http://example.com");    
   curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         
   $dt = curl_exec($ch);
preg_match('/name=\"qxci\" value=\"(.*?)\"/',$dt,$qxc);
$qxci = $qxc[1];
preg_match('/name=\"QuestionId\" value=\"(.*?)\"/',$dt,$qi);
$qid = $qi[1];

preg_match('/value=\"(.*?)\" name=\"OptionId\"/',$dt,$oi);
$oid = $oi[1];


preg_match('/name=\"OptionId\" value=\"(.*?)\"/',$dt,$poi);

$poid = $poi[1];

if(!$oid)
{
$roid = $poid;
}
else
{
$roid = $oid;
}


preg_match('/"ps_bg1">(.*?)</',$dt,$pk);
$ps = $pk[1];
preg_match('/"rs_bg1">(.*?)</',$dt,$rkk);
$rs = $rkk[1];

preg_match('/uestion no: -(.*?)</',$dt,$rkkk);
$pollnumber = $rkkk[1];

if(stristr($dt,"xxxxxxxxxxxx"))
{
$myq = rand(1,999);
$o1 = rand(1,9);
$o2 = rand(8,19);
$o3 = rand(21,29);
$o4 = rand(5,19);
$post_data5 = "zxcoiesesscd=&PollUserName=$tomob&PollUserQuestion=Which is The Next Letter of $myq&Option1=$o1&Option2=$o2&Option3=$o3&Option4=$o4";
   curl_setopt($ch, CURLOPT_URL,"http://example.com");    
   curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data5);
   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         
   $st = curl_exec($ch);


   if(strstr($st,"uestionSaved.php"))
{
echo "<b><font color=magenta>xxxxxxxxxxxxxxxxxx.</font></b><br>";
}
   elseif(strstr($st,"xxxxxxxxxxx"))
{
echo "<b><font color=skyblue>xxxxxxxx.</font></b><br>";

}
else
{
curl_setopt($ch, CURLOPT_URL,"http://example.com");    
   curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         
   $dt = curl_exec($ch);
echo "<b><font color=brown>xxxxxxxxxxxxxxxxxx.</font></b><br>";
}
}
else
{
$post_data3 = "qxci=$qxci&QuestionId=$qid&OptionChecked=1&zxcoiesesscd=&OptionId=$roid";
   curl_setopt($ch, CURLOPT_URL,"http://example.com");    
   curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data3);
   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         
   $at = curl_exec($ch);

   if(strstr($at,"xxxxxxxx.php"))
{
echo "<b><font color=green>".$pollnumber." xxxxxxxxxxxxxxxxxxxxxxxxx.</font></b><br>";

echo "<b><font color=blue>Balance: ".$rs.".".$ps."</font></b><br>";



}
else
{
echo "<b><font color=red>xxxxxxxxxxxxxxxxxxxxxx.</font></b><br>";
}
}
}
//poll ends

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

preg_match_all("/document.getElementById(.*?).value/",$dt,$mbll);
$mbl = $mbll[1][16];
$mbl = str_replace("('","",$mbl);
$mbl = str_replace("')","",$mbl);
preg_match_all('/textarea name=\"(.*?)\"/i',$dt,$msgg);
$m1 = $msgg[1][0];

$m2 = $msgg[1][1];

$m3 = $msgg[1][2];

$m4 = $msgg[1][3];

$m5 = $msgg[1][4];

$m6 = $msgg[1][5];

$m7 = $msgg[1][6];

$m8 = $msgg[1][7];
$ff ="1";

$time = date('H')+1;
$time="$time:00 - $time:59";
$day=date('d');
$month=date('m');


         for($loop=1;$loop<=$ff;$loop++)
         {

      $msssg = randomstring();
$post_data2 = "zxcoiesesscd=&MessageLength=140&GlobalKeyValue=1&$mbl=$tomob&$m1=$msssg&$m2=$msssg&$m3=$msssg&$m8=$msssg&$m4=$msssg&$m5=$msssg&$m6=$msssg&$m7=$msssg&SendNow_=Send Now&BtnSendNow_=Send Now&Day=$day&Month=$month&Year=2013&TimeInterval=$time";
   curl_setopt($ch, CURLOPT_URL,"http://example.com");    
   curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         
   $dt = curl_exec($ch);

   if(strstr($dt,"msgSent.php"))
{
curl_setopt($ch, CURLOPT_URL,"http://example.com");    
   curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
   curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         
   $dt = curl_exec($ch);
echo "<b><font color=green>".$loop." xxxxxxxxxxxxxxx.</font></b><br>";

}
else
{
echo "<b><font color=red>ccccccccccccccccccc.</font></b><br>";
}
}
//www ends





}
print"<div style='background:grey;padding:4px;color:white' align='center'>© script by xxxxx.</div>";
?>
 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/278298-curl-helpplzzzzzzzzzzzzzz/
Share on other sites

What do you mean you want to run curl in "50 time"? 50 seconds? That will still depend on your server configuration and the default cURL timeout. I don't know if it's just me or I really did not get what you wanted to know.

 

And please, enclose your code in the forum's built-in code block. Man, was that painful to read.

What do you mean you want to run curl in "50 time"? 50 seconds? That will still depend on your server configuration and the default cURL timeout. I don't know if it's just me or I really did not get what you wanted to know.

 

And please, enclose your code in the forum's built-in code block. Man, was that painful to read.

i am new in codinng n forrum so i dont know how to post..........so i am verrr sorry..........    and i want to run this curl 50 times..........but i dont knoe how to loop or how to edit this curl    for more time runing........sory for my bad english..........

You want to make 50 HTTP requests to the same domain by CURL getting different content or 50 requests to different domain names?

  if my all code=1requests

 

 

so i want

 

50 HTTPrequests

 

to the same domain by CURL getting different content....

 

 

 

 

 

and   plzzzzzzzz tell me how enclose code in the forum's built-in code block.

 

sorry for bad eng.....   

Edited by ShivaGupta

You have to get all content from this domain and using RegEX to grab only this one that you want to be displayed to your web site - this is my method.  

 

If this content is dynamic one and is being changed constantly, you could run the same script multiple times by cron job for example every 10 min to get updates.

 

I've never used CURL in php only in Bash, so check the documention at php.net, there are lots of examples.

You have to get all content from this domain and using RegEX to grab only this one that you want to be displayed to your web site - this is my method.  

 

If this content is dynamic one and is being changed constantly, you could run the same script multiple times by cron job for example every 10 min to get updates.

 

I've never used CURL in php only in Bash, so check the documention at php.net, there are lots of examples.

ya  same script multiple times...and quick......u r right  sir and i dont want any update frm site .it is for first login then play 1 quiz  then play a poll then send a sms.....    >play 1 quiz  then play a poll then send a sms.....

>play 1 quiz  then play a poll then send a sms.....

>play 1 quiz  then play a poll then send a sms.....

 

total 50 quiz sms and poll

Edited by ShivaGupta

<?php
set_time_limit(0);
$url = $_SERVER['HTTP_HOST'];
print"<title>xxxxx</title>
<div style='background:grey;padding:6px;color:white' align='center'><b>$url</b> -xxxxxxxxx</div> ";

$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);
}


$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"))
{
$post_data2 = "captchaType=google&loginButton=LOGIN&recaptcha_challenge_field=$c&recaptcha_response_field=$cv";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);

if(!stristr($dt,xxxxx.php"))
{ die("<font color='red'><b>Invalid Captcha. Try Again.</b></font>"); }
}
$ff ="1";

for($loop=1;$loop<=$ff;$loop++)
{

$post_data2 = "";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);

preg_match('/name=\"qxci\" value=\"(.*?)\"/',$dt,$qxc);
$qxci = $qxc[1];
preg_match('/name=\"QuestionId\" value=\"(.*?)\"/',$dt,$qi);
$qid = $qi[1];
preg_match('/"ps_bg1">(.*?)</',$dt,$pk);
$ps = $pk[1];
preg_match('/"rs_bg1">(.*?)</',$dt,$rkk);
$rs = $rkk[1];
$sub = "1";

preg_match('/Question number:-(.*?)</',$dt,$aid);
$ansid = $aid[1];
$ansid2 = $ansid - $sub;

$ansit = $raman[$ansid2];
preg_match('/input type=\"text\" name=\"(.*?)\" id=\"(.*?)\" class=\"inputtxt\" value=\"Type your answer here\" style=\"border:0 none;\"/',$dt,$asninput);
$rasninput = $asninput[1];

$post_data3 = "qxci=$qxci&QuestionId=$qid&zxcoiesesscd=&$rasninput=$ansit";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data3);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$at = curl_exec($ch);


if(strstr($at,"xxx.ph"))
{
echo "<b><font color=green>".$ansid." xxxxxxxx.</font></b><br>";

echo "<b><font color=blue>Balance: ".$rs.".".$ps."</font></b><br>";

}
elseif(strstr($at,"xxxxx.ph"))
{
echo "<b><font color=magenta>xxxxxxxxxxxxxxxx.</font></b><br>";

}
else
{
echo "<b><font color=red>".$ansid." xxxxxxxxxxxx.</font></b><br>";
}
}
//rrrr ends


$ff ="1";

for($loop=1;$loop<=$ff;$loop++)
{

$post_data2 = "";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);
preg_match('/name=\"qxci\" value=\"(.*?)\"/',$dt,$qxc);
$qxci = $qxc[1];
preg_match('/name=\"QuestionId\" value=\"(.*?)\"/',$dt,$qi);
$qid = $qi[1];

preg_match('/value=\"(.*?)\" name=\"OptionId\"/',$dt,$oi);
$oid = $oi[1];


preg_match('/name=\"OptionId\" value=\"(.*?)\"/',$dt,$poi);

$poid = $poi[1];

if(!$oid)
{
$roid = $poid;
}
else
{
$roid = $oid;
}


preg_match('/"ps_bg1">(.*?)</',$dt,$pk);
$ps = $pk[1];
preg_match('/"rs_bg1">(.*?)</',$dt,$rkk);
$rs = $rkk[1];

preg_match('/uestion no: -(.*?)</',$dt,$rkkk);
$pollnumber = $rkkk[1];

if(stristr($dt,"xxxxxxxxxxxx"))
{
$myq = rand(1,999);
$o1 = rand(1,9);
$o2 = rand(8,19);
$o3 = rand(21,29);
$o4 = rand(5,19);
$post_data5 = "zxcoiesesscd=&PollUserName=$tomob&PollUserQuestion=Which is The Next Letter of $myq&Option1=$o1&Option2=$o2&Option3=$o3&Option4=$o4";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data5);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$st = curl_exec($ch);


if(strstr($st,"uestionSaved.php"))
{
echo "<b><font color=magenta>xxxxxxxxxxxxxxxxxx.</font></b><br>";
}
elseif(strstr($st,"xxxxxxxxxxx"))
{
echo "<b><font color=skyblue>xxxxxxxx.</font></b><br>";

}
else
{
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);
echo "<b><font color=brown>xxxxxxxxxxxxxxxxxx.</font></b><br>";
}
}
else
{
$post_data3 = "qxci=$qxci&QuestionId=$qid&OptionChecked=1&zxcoiesesscd=&OptionId=$roid";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data3);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$at = curl_exec($ch);

if(strstr($at,"xxxxxxxx.php"))
{
echo "<b><font color=green>".$pollnumber." xxxxxxxxxxxxxxxxxxxxxxxxx.</font></b><br>";

echo "<b><font color=blue>Balance: ".$rs.".".$ps."</font></b><br>";



}
else
{
echo "<b><font color=red>xxxxxxxxxxxxxxxxxxxxxx.</font></b><br>";
}
}
}
//poll ends

curl_setopt($ch, CURLOPT_URL,"http://example.com");

curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);


curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);

preg_match_all("/document.getElementById(.*?).value/",$dt,$mbll);
$mbl = $mbll[1][16];
$mbl = str_replace("('","",$mbl);
$mbl = str_replace("')","",$mbl);
preg_match_all('/textarea name=\"(.*?)\"/i',$dt,$msgg);
$m1 = $msgg[1][0];

$m2 = $msgg[1][1];

$m3 = $msgg[1][2];

$m4 = $msgg[1][3];

$m5 = $msgg[1][4];

$m6 = $msgg[1][5];

$m7 = $msgg[1][6];

$m8 = $msgg[1][7];
$ff ="1";

$time = date('H')+1;
$time="$time:00 - $time:59";
$day=date('d');
$month=date('m');


for($loop=1;$loop<=$ff;$loop++)
{

$msssg = randomstring();
$post_data2 = "zxcoiesesscd=&MessageLength=140&GlobalKeyValue=1&$mbl=$tomob&$m1=$msssg&$m2=$msssg&$m3=$msssg&$m8=$msssg&$m4=$msssg&$m5=$msssg&$m6=$msssg&$m7=$msssg&SendNow_=Send Now&BtnSendNow_=Send Now&Day=$day&Month=$month&Year=2013&TimeInterval=$time";
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);

if(strstr($dt,"msgSent.php"))
{
curl_setopt($ch, CURLOPT_URL,"http://example.com");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, "http://example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$dt = curl_exec($ch);
echo "<b><font color=green>".$loop." xxxxxxxxxxxxxxx.</font></b><br>";

}
else
{
echo "<b><font color=red>ccccccccccccccccccc.</font></b><br>";
}
}
//www ends





}
print"<div style='background:grey;padding:4px;color:white' align='center'>© script by xxxxx.</div>";
?>
  • Solution

If you wanted to run a specific code in PHP 50 times, you can use any of the loops, depending on how you want to use it.

 

Using the "for" loop:

for($i=0;$i=50;$++) {
  // Your code Here
}

Using the "while" loop

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

Replace " // Your code here " with the code you want to repeat. I don't want to bother reading all of your code to figure out which one. lol.

If you wanted to run a specific code in PHP 50 times, you can use any of the loops, depending on how you want to use it.

 

Using the "for" loop:

for($i=0;$i=50;$++) {
  // Your code Here
}

Using the "while" loop

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

Replace " // Your code here " with the code you want to repeat. I don't want to bother reading all of your code to figure out which one. lol.

plz   read my code again  because  ihave tryed and not working for me ..........

If you wanted to run a specific code in PHP 50 times, you can use any of the loops, depending on how you want to use it.

 

Using the "for" loop:

for($i=0;$i=50;$++) {
  // Your code Here
}

Using the "while" loop

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

Replace " // Your code here " with the code you want to repeat. I don't want to bother reading all of your code to figure out which one. lol.

i thik given code for 1 http request loop......and my code have 5 http req .........so how to loop plzzzzzzzzz help

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.