Jump to content

Recommended Posts

Posted

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?

Posted (edited)

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 :D

 

I think you can echo ''; for PHP and a document.write() in JS... oce you've checked the date...

 

$date = date("dmy");
if( $date = "011208" ){
   echo '';
} else {
   echo '';
}

?>

Edited by Lithium
suddenly learnt php
  • Thanks 1
Posted (edited)

In ASP you could use

<%
if date < #01/01/2009# then
response.write ""
else
response.write  ""
end if
%>

And you can just place that where you would normally have your CSS reference.

 

In PHP it would be

   if (date(m)=="12")
{
   echo "";
} else {
   echo "";
}
?> 

 

Edit: Beat me to it Lithium!

And yes, a document.write should work in the javascript, which shouldn't be too far off the PHP

Edited by mrcrazy04
Fixed PHP
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...