Just use a mysql database to store the names, then you can connect to the database, and select a random name.. here is an example of a random i made for a simple video game lotery
<?php
// Echo random
$username="db_user"; //enter your database username
$password="password"; //enter your db password
$database="db_name"; //enter the name of your database
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query= "SELECT * FROM pins WHERE used > 0 ORDER BY RAND() LIMIT 1";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
$i=0;
while ($i < $num) {
$Pin=mysql_result($result,$i,"pin");
echo"$Pin";
$i++;
};
?>
It selects a random row from a mysql database that has the column value greater that 0. Then it echos it out...
Go check it out - http://ggdesigning.com/test_random.php
G&G Designing
Junior Poster in Training
90 posts since Aug 2011
Reputation Points: 17
Solved Threads: 11