lonsalot Posted August 14, 2006 Share Posted August 14, 2006 Can anybody show me how to include a page based on the date. I would like to have a different page depended on what day of the year it is. So the code should include Leap Years too. Has anybody seen this done before with PHP. I can't imagine that it's that hard. I just am not familar that much with PHP. If there is a link to a tutorial that is similar to this, could you let me know.Thanks,Lonsalot Quote Link to comment Share on other sites More sharing options...
hackerkts Posted August 14, 2006 Share Posted August 14, 2006 Example:[code]<?php$date = date("d.m.Y"); // dd.mm.yyyy$date1 = explode(".", $date);/*echo$date1[0] // dd$date1[1] // mm$date1[2] // yyyy*/if ($date1[0] == "14" && $date1[1] == "08" && $date1[2] == "2006"){ echo "There";}?>[/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted August 14, 2006 Share Posted August 14, 2006 [code]include date('Md') . '.php';[/code]This will include "Aug14.php" today Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.