function compute_random_number($top_num, $new_seed) { $seed = date("U"); if($new_seed): $seed = date("U") % $new_seed * $new_seed; endif; srand($seed); $num = 1 + Rand() % $top_num; return $num; } function check_for_duplicates($array_1, $number) { $i=0; $stop=0; $num=count($array_1); while($i < $num): if($number == $array_1[$i]): return 1; else: $i++; endif; endwhile; return 0; } function get_card_information($numb) { global $description_file, $file_name, $card, $caption; $query = "select * from hollywoodtarot where card_id = $numb"; $result = mysql("hollywoodtarot", $query); $description_file = mysql_result($result, 0, "description_file"); $file_name = mysql_result($result, 0, "file_name"); $card = mysql_result($result, 0, "card"); $caption = mysql_result($result, 0, "caption"); } /* initialize parameters */ $description_file = ""; /* description of the card from the database */ $file_name= ""; /* file name of the picture used to display the card */ $card=""; /* the card's name */ $caption=""; /* the card's caption */ $result_num_records = mysql("hollywoodtarot", "select count(*) as high from hollywoodtarot"); /* get number of */ $records = mysql_result($result_num_records, 0, "high"); /* records found */ /* in the dbase. */ ?>
This is either (1) your meditation card for today, or (2) the severely edited answer to your question.
/******** Do Not Erase - CARD 01**********/ $random_num = compute_random_number($records, 0); $duplicate_array[0] = $random_num; get_card_information($random_num); /*********************************/ ?> echo $card; ?>
echo $caption; ?> include $description_file; ?>
| Home | Hollywood Tarot: Ask Your Question | Who's On What Card | Lady Esmene and Madame Esmeralda Read The Cards | Links | FAQ | Make Your Own Deck