4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Using different CSS for a different date
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
badger
Junior WebHelper
Junior WebHelper


Joined: 08 Oct 2004
Posts: 10

PostPosted: Wed Oct 27, 2004 11:33 am (13 years, 1 month ago) Reply with QuoteBack to Top

Hi,

Im trying to change the CSS on a particular date?

Friday 29.10.04 is breast cancer awareness day and my company is having a pink day! I want the change the css so on the 29.10.04 it will display a different css (the pink one!)

I have created 2 *.php files each containing simular to the following:

Code:
<link rel="stylesheet" type="text/css" href="pink_style_CAID.css">


Then trying to use this code

Code:
<?php

$time = date("m.d.y");
if ($time = 29.10.04) {
require "pink/pink.php";
}
else {
require "pink/normal.php";
}
?>


its doesn't work! Doh!

Can anyone help??
OfflineView User's ProfileFind all posts by badgerSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Oct 27, 2004 12:30 pm (13 years, 1 month ago) Reply with QuoteBack to Top

Hi badger,

Try replacing
Code:
29.10.04
with
Code:
"29.10.04"
and replacing
Code:
=
with
Code:
==


I take it you are replacing 29 with 27 to test it today aren't you?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
badger
Junior WebHelper
Junior WebHelper


Joined: 08 Oct 2004
Posts: 10

PostPosted: Wed Oct 27, 2004 12:40 pm (13 years, 1 month ago) Reply with QuoteBack to Top

Excellent!!!

Thanks Daniel Very Happy

Final code used:

Code:
<?php

$time = date("m.d.y");
if ($time == "10.29.04") {
require "pink/pink.php";
}
else {
require "pink/normal.php";
}
?>


Notice I also changed the date format as that was also incorrect.

This code swaps the CSS depending on the date selected.

badger Razz
OfflineView User's ProfileFind all posts by badgerSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.067039 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme