danIT (26th November 2008)
Heres what im looking to do:
On a certain date reference one css.file but after that date forget about it.
On December 1st display december.css but on 1st January display regular.css
Any ideas? Could be PHP aswell?
in PHP you can just use the date() function to look up that...
I think Javascript has a similar function and would work in a similar.
I haven't done anything with PHP or Javascript so I'm useless to you beyond that
I think you can echo '<link....>'; for PHP and a document.write() in JS... oce you've checked the date...
PHP Code:<?php
$date = date("dmy");
if( $date = "011208" ){
echo '<link ref="blah blah blah">';
} else {
echo '<link ref="usual blah blah blah">';
}
?>
Last edited by Lithium; 26th November 2008 at 03:05 PM. Reason: suddenly learnt php
danIT (26th November 2008)
In ASP you could use
And you can just place that where you would normally have your CSS reference.Code:<% if date < #01/01/2009# then response.write "<link href='december.css' rel='stylesheet' type='text/css' />" else response.write "<link href='normal.css' rel='stylesheet' type='text/css' />" end if %>
In PHP it would be
Edit: Beat me to it Lithium!PHP Code:<?php
if (date(m)=="12")
{
echo "<link href='december.css' rel='stylesheet' type='text/css' />";
} else {
echo "<link href='normal.css' rel='stylesheet' type='text/css' />";
}
?>
And yes, a document.write should work in the javascript, which shouldn't be too far off the PHP
Last edited by mrcrazy04; 26th November 2008 at 03:16 PM. Reason: Fixed PHP
danIT (26th November 2008)
There are currently 1 users browsing this thread. (0 members and 1 guests)