Event on Website?
- Started
- Last post
- 7 Responses
- acescence0
if you close the php in between, you can insert any html you want:
<?php
$date = mktime( 0,0,0,8,4,2010 );
if ( $date > time() ) { ?>any html here
<?php } else { ?>
any html here
<?php } ?>
- acescence0
another option is to include external html files:
<?php
$date = mktime( 0,0,0,8,4,2010 );
if ( $date > time() ) {
include "before.html";
} else {
include "after.html";
}
?>
- Knuckleberry0
thank you so much.
- chalk0
You could do this with PHP very easily. I did something similar recently with an image-swap for time of day, day of week. with Javascript, but it is localized, and not based on a server-time, so people in different areas of the world will see different things. http://dylanmullins.com/dev/timeā¦
Your best bet is likely PHP.
- acescence0
<?php
$date = mktime( 0,0,0,8,4,2010 );
if ( $date > time() ) {
echo "content before date";
} else {
echo "content after date";
}
?>
- orrinward0
This is very easy basic PHP stuff and works more or less how you thought.
I've only done a bit of PHP and it was a couple of years ago, so the syntax is wrong, but it is as simple as:
if (DATE<Christmas Day) {
HTML SAYING 'CHRISTMAS COMING SOON'
}
else(){
HTML SAYING 'MERRY CHRISTMAS'
}Sort of stuff.
- ascescence is more on the mark here. I didn't think echo was necessary though.orrinward
- Knuckleberry0
thanks for your help you guys (or girls).
acescence: would that code be able to show images?