Re: How to change pictures everyday using php
- From: "Joseph Melnick" <jmelnick@xxxxxxxx>
- Date: Mon, 30 May 2005 16:33:28 -0400
Hello Luigi,
What you could try: without using a database.
1. create a file with all of the picture names. named: pictures.txt
name1.jpg
name2.jpg
name3.jpg
2. use date() to give you the day of the year
$todayspicture = 'defaultpic.jpg';
$dayofyear = date("z"); // day of year 0-365
// today is day 149 so to start from zero subtract from 149 from $dayof year
$lines = file("pictures.txt");
if(count($lines)<$dayofyear) $todayspicture = $lines[$dayofyear];
Hope this helps
Joseph Melnick
JM Web Consultants
http://www.jphp.com
.
- Follow-Ups:
- Re: How to change pictures everyday using php
- From: Tony
- Re: How to change pictures everyday using php
- From: Luigi Donatello Asero
- Re: How to change pictures everyday using php
- References:
- How to change pictures everyday using php
- From: Luigi Donatello Asero
- Re: How to change pictures everyday using php
- From: Geoff Berrow
- Re: How to change pictures everyday using php
- From: Luigi Donatello Asero
- Re: How to change pictures everyday using php
- From: Luigi Donatello Asero
- How to change pictures everyday using php
- Prev by Date: Re: How to change pictures everyday using php
- Next by Date: Re: How to change pictures everyday using php
- Previous by thread: Re: How to change pictures everyday using php
- Next by thread: Re: How to change pictures everyday using php
- Index(es):