TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

URGENT! script that checks what day it is and displays a text file

Page: 1 Reply
Sep 9th 2002#68384 Report
Member since: Sep 3rd 2002
Posts: 22
hi
how can i make it so it searches for the day of the week and displays a text file corresponding to that day?

i used to no but i forget

please help! its for a client and i only have a couple of days
Reply with Quote Reply
Sep 9th 2002#68402 Report
Member since: Jun 30th 2001
Posts: 447
I don't think you can include files in JavaScript, so you'll have to use some sort of server-side script, like PHP. A sample PHP script is below:

[php]$day = date('w');

switch ($day) {
case 0:
include 'sunday.txt';
break;
case 1:
include 'monday.txt';
break;
case 2:
include 'tueday.txt';
break;
....and so on to case 6, which is Saturday....
}
?>[/php]
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum