Jump to content

PHP Calender? (how can i do this..?)


Incredinot

Recommended Posts

Hi..

 

I am trying to achieve somthing, but cant really figure out how to do it.

Some part of me is telling me thats it "rather simple", but ofcourse its now, then i would've figured it out instead of asking :b

 

So what i want is a calender..

Ive found a rather short coded one here, and it is fine for what i need.

http://www.plus2net.com/php_tutorial/php_calendar.php?prm=11&chm=-1

 

Now what i want is to push another style into dates where i have information.

I have all this information stored in a database.

 

My database is like:

 

Dates ->

id

Timestamp

Information

 

So...

 

Lets say we are able to se the whole calender for december right 2009 now.

 

Then at the 24 december i have a timestamp thats "xxxx" and information thats "xxxx" in my database.

The < td > tag should then instead contain a style that ill define.

Lets say

 

$style_with = "style=\"background-color:#f00;\">

$style_without = "style=\"background-color:#fff;\">

 

Then i what i want is roughly:

 

If date is NOT in db - {echo $style_without;}.

If date IS in db - {echo $style_with;}.

 

So how can i tell "if the date is greater than 24 december 00:00 and less than 25 december 23:59"?

 

Hope someone could help me out.. That would be the best christmas gift this year :b

 

Merry christmas!

 

Link to comment
https://forums.phpfreaks.com/topic/185571-php-calender-how-can-i-do-this/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.