Jump to content

Need some help with this


devWhiz

Recommended Posts

I need to be able to echo everythink that is in an array, It has to echo all of them, the code I have written would only echo 3 out of the 5 sometimes less sometimes it will repeat the same thing 2 or 3 times, I need it to be different each time, it should be able to echo all 5 parts of the array randomly and then it keep going in a cycle...

 

ive tried

 

array_rand()

rand()

shuffle()

 

with no luck, Any help is appreciated,

Link to comment
https://forums.phpfreaks.com/topic/238172-need-some-help-with-this/
Share on other sites

let me see if I can explain with more detail

 

basically what I can trying to do is this

 

 

I have a file with ID numbers and security keys for my user accounts in this format

 


// ID(space)Security Key

12354390 48ghsgyew89380sdjoakk
12345560 38gdsfdsgdfhfdsfdsfwwrk
12346660 48jod43dsgdrfgdfewewrk

 

That is just gibberish above to show as an example, this is the code I use to sort the ID and security tokens from the  text file

 


<?php

$keys = file($info_file);
foreach($keys as $values)
  {
  $Var = explode(' ', $values);
  $Info[] = array($Var[0], trim($Var[1]));
  }

?>

 

so after using that ... $Info[0] would equal 12354390 and $Info[1] would equal 48ghsgyew89380sdjoakk

 

Here is the loop I use

 


$Variable[] = "var 1";
$Variable[] = "var 2";
$Variable[] = "var 3";


for($i=0; $i<count($Info); $i++)
  {
for($a=0; $a<count($Variable); $a++)
  {
	$load = file_get_contents('http://www.example.com/k?='.$Info[$i][0].'&variable='.$Variable[$a].'&security='.$Info[$i][1]);
	sleep(1);
  }
  }

 

I need to randomize the $Info array in the file_get_contents and I would like to randomize the $Variable as well, the "$i" in $Info[$i][0] amd $Info[$i][1] has to be the same so it matches up, or else it would failed the security check... I would need it to randomize but not repeat any of the variables when it loads the webpage, cannot repeat, or cannot miss any, I know that sounds confusing Lol, let me know and I will try to explian a little bit better

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.