|
Posted by Krustov on 10/01/07 18:12
<comp.lang.php>
<itcassy>
<Mon, 01 Oct 2007 17:56:53 -0000>
<1191261413.250677.48280@d55g2000hsg.googlegroups.com>
> Thanks for the quick response! However, I am not sure this will work.
> Maybe I can clarify... I want the page to automatically choose a
> different dealer to display automatically every week. Just like a
> random sort except not every time you load the page, I only want the
> code to choose a new dealer every week. If I save the temp time to
> the db, it would only work once (?) for the first week? Please
> correct me if I am not following....
>
Yes i know what you want - but theres no way for anybody but yourself to
know how much or how little php skills you have - some people only need
a pointer and some people need more help .
At the end of the week - just repeat the $temp process to pick another
dealer to be shown - then repeat again the next week etc .
Assuming you have 50 dealers .....
$batman=(rand()%50);
This will pick a number between 0-49
If dealer number 22 is picked then store dealers name No. 22 in the
database or a flat file .
Then retrieve the dealers name from the database or flat file anytime
the index.php is loaded - and anytime it does this - then check the
$temp to see if its older than one week old .
--
www.vhit.co.uk
Navigation:
[Reply to this message]
|