Re: random HTML pages from PHP calls
| From: | Justin French | Date: | Mon, 27 May 2002 12:51:35 +0000 |
| Subject: | Re: random HTML pages from PHP calls | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99363@lists.php.net to get a copy of this message | ||
What's the connection between the id and the random pages?
if you had 10 "html page" file names in a MySQL table, or an array, you'd be
able to pick one of them at random and include it.
eg SELECT file_name FROM files ORDER BY RAND() LIMIT 1
never had to do it with an array, but i'm guessing array_rand() is what you
wanna look at
http://www.php.net/manual/en/function.array-rand.php
justin french
on 28/05/02 11:19 AM, r (r@jumac.com) wrote:
> Hey all,
>
> I'm calling a PHP "GimmeRandom.php?id=35557" and what this page does is take
> the "id" and update the number in the database by +1 (till here no problem)
> then what its supposed to do is give me ANY ONE of 10 prewritten html pages
> in a random order.
>
> I know this is pretty easy but my brain just aint working today....
>
> Cheers,
> -Ryan.
>