/    Sign up×
Community /Pin to ProfileBookmark

Display page on given day of week

Is there a way in HTML to display a given page based on the day of the week it is? For instance, if it was Thursday is would display Thursday.htm page, or On Tuesdays and Thursdays display certain page. This could be useful for weekly sales offerings, etc.

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@the_treeNov 05.2006 — Not with HTML, which has no dynamic capabilities. Javascript could manage it but a server-side language (if avaliable) such as PHP or ASP would be preferable.
Copy linkTweet thisAlerts:
@22PixelsNov 06.2006 — <a href="<?php echo date('l'); ?>.html">Click Here To Continue</a>

Name your pages Sunday.html, to Saturday.html

NOTE* Server must support php and in most cirumstances file must have a .php extension.

There are other ways to do this with javascript, but I am most familiar with PHP myself.
Copy linkTweet thisAlerts:
@the_treeNov 06.2006 — [i]If[/i] you were going with a PHP solution, then I would not be directing your users to different documents, it would just confuse the hell out of search engines and anyone bookmarking your site.

I would just print different content on the same document, probably with the aid of a [url=http://uk.php.net/switch]switch()[/url] statement.
Copy linkTweet thisAlerts:
@Canta_LibreauthorNov 07.2006 — I don't wish to have someone click on it, I wish it to load automatically on a given day.
Copy linkTweet thisAlerts:
@22PixelsNov 07.2006 — <?php

$today = date('l');

header("Location: $today.html");

?>
×

Success!

Help @Canta_Libre spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...