24-Hour Switch
Moderator: General Moderators
- SilverMist
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 02, 2004 2:06 pm
- Location: Canada
- Contact:
24-Hour Switch
Is it possible to make a code that, after twenty four hours, switches a quote. Like a new quote would appear every 24 hours... If this is possible, does anyone have any ideas on how it would be coded?
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
- SilverMist
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 02, 2004 2:06 pm
- Location: Canada
- Contact:
- SilverMist
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 02, 2004 2:06 pm
- Location: Canada
- Contact:
- SilverMist
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 02, 2004 2:06 pm
- Location: Canada
- Contact:
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
then every time someone loads the page, save the date to a field on the db. But before that, check if the the current date matches the one on the database.
... or something like that
Code: Select all
<?
$last_day_q = mysql_query('SELECT last_day FROM some_table');
$last_day = mysql_result($last_day_q, 0);
if (date("d")==$last_day) {
// do this
} else {
// do that
}
$today = date("Y-m-d");
$save_day = mysql_query("INSERT INTO some_table (last_day) VALUES( '$today");