SUBSCRIBE if my tutorial help you… COMMENT if you got anything to say… RATE to see if you like the tutorial… Next Part …
Original source
SUBSCRIBE if my tutorial help you… COMMENT if you got anything to say… RATE to see if you like the tutorial… Next Part …
Original source
13 responses to “PHP MYSQL Event Calender Tutorial Part 1_1 : Basic Calender”
this tutorial save my life
thank you very much
https://github.com/iphpbb/eventcalendarbb/
very helpful!
you can upload code.
Show the calendar on what it looks like before going into the tutorial, so users can determine if that is what they want to use in the first place, just FYI
Thank you! Your Codes is Awesome!!
Hello everybody,
How can i do to begin the week with Monday ?
I follow your codes but its not working.
<html>
<head>
<script>
function goLastMonth(month, year){
if (month == 1) {
–year;
month = 13;
}
document.location.href="<?php $_SERVER['PHP_SELF'];?>?month="+(month-1)+"$year="+year;
}
function goNextMonth(month, year){
if (month == 12){
++year;
month = 0;
}
document.location.href="<?php $_SERVER['PHP_SELF'];?>?month="+(month+1)+"$year="+year;
}
</script>
</head>
<body>
<?php
if(isset($_GET['day'])){
$day = $_GET['day'];
}else{
$day=date("j");
}
if(isset($_GET['month'])){
$month = $_GET['month'];
}else{
$month=date("n");
}
if(isset($_GET['year'])){
$year = $_GET['year'];
}else{
$year=date("Y");
}
$day=date("j");
$month = date("n");
$year = date("Y");
echo $day."/".$month."/".$year;
$currentTimeStamp = strtotime("$year-$month-$day");
$monthName = date("F", $currentTimeStamp) ;
$numDays = date("t", $currentTimeStamp) ;
$counter = 0;
?>
<table border='1'>
<tr>
<td> <input style='width:50px;' type='button' value='<' name='previousbutton' onclick="goLastMonth(<?php echo $month.",".$year?>)"> </td>
<td colspan='5'><?php echo $monthName.", ".$year; ?></td>
<td> <input style='width:50px;' type='button' value='>' name='nextbutton' onclick="goNextMonth(<?php echo $month.",".$year?>)"></td>
</tr>
<tr>
<td width='50px'>Sun</td>
<td width='50px'>Mon</td>
<td width='50px'>Tue</td>
<td width='50px'>Wed</td>
<td width='50px'>Thu</td>
<td width='50px'>Fri</td>
<td width='50px'>Sat</td>
</tr>
<?php
$day=date("j");
$month = date("n");
$year = date("Y");
echo "<tr>";
for($i = 1; $i < $numDays + 1; $i++, $counter++){
$timeStamp = strtotime("$year-$month-$i");
if($i == 1){
$firstDay = date("w", $timeStamp);
for($j = 0; $j < $firstDay; $j++, $counter++){
echo"<td> </td>";
//echo "<td align='center'>".$i."</td>";
}
}
if($counter % 7 == 0){
echo"</tr><tr>";
}
}
echo "</tr>";
?>
</table>
</body>
</html>
great
thank you very much for your code, very useful
thanks @_@ 🙂
will this work if i only put it in a div or table so that it will be just a part of a webpage? im a newbie about this…thanks
Thank you so much my friend… you saved my life!! 🙂
why no voice