Home TheRandomizer Forum Index Log in Register FAQ Search
TheRandomizer Forum Index » General Support » Randomizer Help
Post new topic  Reply to topic View previous topic :: View next topic 
Randomizer Help
PostPosted: Wed Feb 18, 2004 8:23 pm Reply with quote
Guest
Guest




Hi All

I purchased a randomizer script and installed it. Now all i get is the error.


Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in /home/eazypaid/public_html/random/randomizer.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /home/eazypaid/public_html/random/randomizer.php:17) in /home/eazypaid/public_html/random/randomizer.php on line 27


Here is the randomizer php file that I have. Could anyone tell me what i am missing?

<?php
require("config.php");
$dbh = mysql_connect ($conf[dbhost], $conf[dbuser], $conf[dbpass]) or die (mysql_error());
mysql_select_db ($conf[dbname]);
srand((double)microtime() * 10000000);
$getemail = "SELECT * FROM people ORDER BY RAND()";
$getemail2 = mysql_query($getemail) or die("Could not get email");
$out = array();
while($row = mysql_fetch_array($getemail2)) {
$id = $row[id];
$i = 1;
while($i < $row[amount]) {
$out[] = $row[email];
$i++;
} // loop all people
}
$rand_keys = array_rand($out, 1);
$email = $out[$rand_keys];

/* debug block VERY LAGGING
echo "<pre>";
print_r($out);
print_r($rand_keys);
echo "\n".$email;
echo "</pre>";
*/
header("location: index.php?id=".$email);
?>

I would really be greatfull for anyone help.
Thanks in advance.
Wink
PostPosted: Wed Feb 18, 2004 8:51 pm Reply with quote
shadow
Addict
Joined: 16 Oct 2003
Posts: 171
Location: Virgin Islands




This isn't the randomizer script from www.therandomizer.net that is supported here but my guess would be that you need to add a member to your database for the script to work. Just to let you know the script you have is very insecure and you can easily steal membership in it.

Shadow
 Randomizer Help 
 TheRandomizer Forum Index » General Support
All times are GMT  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Powered by phpBB© 2001-2006 phpBB Group |Randomizer Script | Web Hosting | phpBB Skin by Vjacheslav Trushkin