Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SHOW PAGES BY CONTROL DATE

Status
Not open for further replies.

inma

Technical User
Apr 5, 2001
49
ES
Hi. I'm new to HTML & Java, and I'm not exactly sure how to do this:
I want show page1.html if day=1 and page2.html if day=16
Anybody can help me?
 
Hi,

Well, this can be done client-side using (f.ex.) JavaScript or server-side by using (f.ex.) PHP.

Each of these languages have their own forum on tek-tips:

JavaScript => forum216
PHP => forum434

Having said that, here's my example written in JavaScript:


Just view the source in your browser to see how it's done.

I would go for a server-side solution -why? client-side solutions (like the one I wrote) will only work if the user has JS enabled on his/her browser.

Regards


Jakob
 
Hi dkdude, thanks for your reply, but I don't think the exemple of is my case.

The pseudocode of my case will be:

IF DAY = 1 OR 16 SHOW PAGE1.HTML
ELSE SHOW PAGE2.HTML.

Could you help me?

Thanks again.
 
still it has to be server side. but u could also do this using javascript:
create a index file:
<script>
dt=new Date()
TheDt=dt.getDate()
location.href="page"+TheDt+".html"
</script>

ofcourse the date will be taken from the client's system time...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top