Click to See Complete Forum and Search --> : Redirecting to specific page based on date
stormrevolution
04-17-2004, 01:58 PM
ive heard of the scripts that can redirect a visitor to your site to different pages for different days of the week like "monday = monday.html etc..etc.." is there one or could there be one that would redirect visitors to a different page depending on the day of the week and the time of day like:
Monday @ 1pm monday1300.html
Monday @ 8pm monday2000.html
Wednesday @ 12pm wednesday1200.html
cheers all in advance.
Khalid Ali
04-17-2004, 02:35 PM
you can use the same logic and create pages for certain periods of day and night and then just get the time using Date object and forward to the page
steelersfan88
04-17-2004, 03:48 PM
kinda like:<script type="text/javascript">
var days = new Array('sunday','monday','tuesday','wednesday','thursday','friday','saturday')
var day = days[new Date().getDay()]
var hour = new Date().getHours() +"00"
window.location = (day+hour) +".htm"
</script>That will get the day, ex. friday, and the hour (1600 for 4:15 PM, for example, and 000 for 12:00 AM) and put it together, like friday1600 and add .htm. and direct user. This could also, maybe better, be done on server side as loading :)
stormrevolution
04-17-2004, 05:34 PM
cheers both, fantastic help, ill give it a go and get back to you shortly
Thanks!
steelersfan88
04-17-2004, 05:42 PM
hope that you find success :D