|
if ($REQUEST_METHOD == "POST")
{
$displayname = $realname;
$realname = strtolower($realname);
/*== generate seed number from name submitted ==*/
$len = strlen($realname);
$seed = 0; $s = 0;
for ($e=1; $e<=$len; $e++)
{
$chr = substr($realname,$s,$e);
$seed = $seed + ord($chr)*$e;
$s=$e;
}
/*== read in the two files into the arrays ==*/
$adj_array = file("wu_adjs");
$noun_array = file("wu_nouns");
/*== set random seed ==*/
srand($seed);
/*== get the random numbers for each name first/last or adj/noun ==*/
$arnd = rand(0,sizeof($adj_array)-1);
$nrnd = rand(0,sizeof($noun_array)-1);
/*== create name from random numbers ==*/
$wuname = "$adj_array[$arnd] $noun_array[$nrnd]";
print "$displayname If you were in the Big Brother 4 House, you would be a ";
print " $wuname ";
}
?>
|