By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,405 Members | 1,687 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,405 IT Pros & Developers. It's quick & easy.

Timed File with PHP

P: n/a
Greetings all... I was told this would be easy with PHP, but I don't
know enough about PHP, so I thought I'd ask here...

I want the main page of my domain to have certain content up until a
certain date, then different content on a different date. I will be out
of town and was hoping this could be done automatically. Someone told
me this would be easy with PHP using the "if else" statements, a
switch, and using the date() functions.

Can anyone help if this is easy, or let me know if this isn't?

Regards

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
NC
rehs...@yahoo.com wrote:

I want the main page of my domain to have certain content up until
a certain date, then different content on a different date.


Easy indeed:

$certain_date = 'May 15, 2005';
$certain_time = strtotime($certain_date);
if (time() > $certain_time) {
echo 'New Content';
} else {
echo 'Old Content';
}

Cheers,
NC

Jul 17 '05 #2

P: n/a
Wow, that's really simple.

Nevertheless, THANK YOU for supplying it!!!

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.