You are here: Re: Problem with random script « PHP Programming Language « IT news, forums, messages
Re: Problem with random script

Posted by Nick on 11/02/06 11:11

Many thanks.
It works fine.
Nick

Kim André Akerø ha scritto:
> Nick wrote:
>
>> Hi,
>>
>> I've an image and a phrase in my home page (index.php) and I'd like
>> to change them randomly each time the page is reloaded. To achieve
>> this goal, I've created a folder and in this folder I've inserted
>> different php files: each file include a different image and an
>> associated phrase. Now I'd like to create in the index.php a script
>> that each time the page is reloaded includes randomly a php file from
>> the folder. The result should be that each time the page is reloaded
>> the image and the phrase change. Can you help me please? Many
>> thanks for the support.
>
> One way to do it:
>
> <?php
> $filelist = glob("dirwithphpfilestoselectatrandom/*.php");
> include($filelist[array_rand($filelist)]);
> ?>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация