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];
I would really be greatfull for anyone help.
Thanks in advance.
Posted: Wed Feb 18, 2004 8:51 pm
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.