PDA

View Full Version : Daily Changing Table


ba_feitl
02-28-2006, 04:13 AM
This probably sounds like a newbie type question but I searched around and can't seem to find a good "walk-me-through" answer anywhere. I'm fairly new to the dynamic web piece.

I want my website to contain a table that changes daily (ie Monday has monday's classes and events, once the server switches to Tuesday it shows tuesdays classes and events, etc through the week). Right now I go in each night and drop in a new snippet that contains the correct table coding... it's getting to be a pain in the rear !

Here's what I know .. My website is set up in DW8, the server runs .ASP, and I have access to ColdFusion if that helps me.

Any guidance or suggestions for more info would be great !

Thanks much,
Brad

ranjan
02-28-2006, 06:23 AM
http://dreamlettes.net/weekBasedTable.html

Check the html, it contains tables for monday to friday, but shows only the table based on day of the week. The javascript does the job

ba_feitl
03-01-2006, 03:11 AM
Thanks for the help...I will try that tonight!

:D

Brad

Creative Insanity
03-01-2006, 06:21 AM
Nice script that rj! ;)

D7
03-06-2006, 02:55 AM
http://dreamlettes.net/weekBasedTable.html

Check the html, it contains tables for monday to friday, but shows only the table based on day of the week. The javascript does the job

Weird, the page never loaded for me :(

However, simply look into date() funtion at the php manual. It should be very easy to do! Might need a little switch() statement:

<?php
$day = $date('d'); //quasi code, please don't copy it!
switch($day) {
case 0:
echo "Sunday";
break;
case 1:
echo "Monday";
break;
}
?>

That is merely an example. But it vastly depends on what you are actually doing with your table.

Cheers.[/code]

desertdirk
03-06-2006, 03:31 AM
I get a javascript error on the link:
line 18
char 4
error Object required
code 0
URL: http://dreamlettes.net/weekBasedTable.html

DD

ba_feitl
03-12-2006, 05:41 AM
Thanks for the script ranjan it works awesome

DD you're getting the error because there are only tables defined in the code for Monday thru Friday. Try the link again on a weekday and it should work fine. It freaked me out for a second too but once you pull out the code and define a table for every day it works like a charm !

Regards,
Brad