You are invited to Log in or Register a free Frihost Account!

Simple Calendar script


I am looking for a simple calendar I can add to my site. I went to do some googling, but most of the calendars out there are WAY too advanced for my use.

What I basicly need is a calendar (monthly calendar) that lists all the days of the month. I should be able to add events, that will make the date look colored on the calendar. If people would click on the date, they would be redirected to a page I costumly made.

If anyone got any suggestions of websites with scripts/what would the best way to do it, please let me know!
Not knowing what's too advanced for you I would suggest using a calendar class, like from

and entering the events into a database

I made my first calendar a few weeks ago by moving an old calendar function into a class and hacked on selecting a week onto it.
Try this


if(isset($prm) and $prm > 0){
$m= date("m");}

$d= date("d");     // Finds today's date
$y= date("Y");     // Finds today's year

$no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month

$mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar

$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar

$j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month

for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";

/// Starting of top line showing name of the days of the week

echo " <table border='1' bordercolor='#FFFF00' cellspacing='0' cellpadding='0' align=center>


echo "<table cellspacing='0' cellpadding='0' align=center width='100' border='1'><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='php_calendar.php?prm=$m&chm=-1'><</a> </td><td colspan=5 align=center bgcolor='#ffff00'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='php_calendar.php?prm=$m&chm=1'>></a> </td></tr><tr>";

echo "<td><font size='3' face='Tahoma'><b>Sun</b></font></td><td><font size='3' face='Tahoma'><b>Mon</b></font></td><td><font size='3' face='Tahoma'><b>Tue</b></font></td><td><font size='3' face='Tahoma'><b>Wed</b></font></td><td><font size='3' face='Tahoma'><b>Thu</b></font></td><td><font size='3' face='Tahoma'><b>Fri</b></font></td><td><font size='3' face='Tahoma'><b>Sat</b></font></td></tr><tr>";

////// End of the top line showing name of the days of the week//////////

//////// Starting of the days//////////
echo $adj."<td valign=top><font size='2' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell
echo " </font></td>";
$j ++;
if($j==7){echo "</tr><tr>";


echo "<tr><td colspan=7 align=center><font face='Verdana' size='2'><a href=''><b> Calendar</b></a></font></td></tr>";
echo "</tr></table></td></tr></table>";
echo "<center><font face='Verdana' size='2'><a href=php_calendar.php>Reset PHP Calendar</a></center></font>";


you should try hotscripts dot com for your calender.

your preferences required that you have a database. which could be either mysql or flatfile. the above code is fine but ur requirement is much more than that/

good luck
Honestly I think I had the same problem at the start of October really, I wanted a basic calendar that would accept data from different tables in SQL. In a case like this my best suggestion is that you just make one yourself so you get what you want. I think mine in total was only about 200 lines and most of that was just formatting. Just try to use what is above as a guide and work from there, should only take about an hour or two really.
As I understand your calendar would be located at your web page? As for forms you can use form builder. With it you can just set up properties to your forms without coding.
Related topics
simple login script
Simple PHP script not working
Install a autosurf script
Upload Script
I need a VERY simple php script
another simple php request
Uploader v6,Shoutbox,Simple Gallery,Simple Directory indexer
Simple (but not too simple) calendar in php
30frih for a php rotator script
Stopping rest of script if certain thing happens...
does someone have a simple "save to txt file" scri
Linux - simple shell script how to turn ECHO off ?
Will work for FRIH$
Protect Your Page With Simple Login But Yet Powerful Script
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

© 2005-2011 Frihost, forums powered by phpBB.