clausowitz Posted July 9, 2011 Share Posted July 9, 2011 I have a calendar displayed in my index.php. When I click next month the whole page gets refreshed. Is there a way that the calendar refreshes without doing the whole page? <?php if (isset($_SESSION['idx'])) { echo '<div class="container" style="font-size:15px; margin-bottom:5px;"> <table width="97%" border="0"> <tr> <td width="78%" ><div style="font-size:15px;"><strong>MAAC Calendar</strong></div></td> <td width="11%"><a href="calen.php"><img src="images/calendar.png" alt="Add or Edit events in the calendar" border="0" align="left" width="30" height="30" /></a></td></tr></table><p>'; include_once "mijnkalender.php"; echo ' </p> </div><br />';} ?> The problem start I guess where the calendar sends variables when the page goes to the next month. <?php if(!isset($_REQUEST['date'])){ $date = mktime(0, 0, 0, date('m'), date('d'), date('Y')); } else { $date = $_REQUEST['date']; } // Build Previous and Next Links $previous_link = "<a href=\"".$_SERVER['PHP_SELF']."?date="; if($month == 1){ $previous_link .= mktime(0, 0, 0, 12, $day, ($year -1)); } else { $previous_link .= mktime(0, 0, 0, ($month -1), $day, $year); } $previous_link .= "\"><< Prev</a>"; $next_link = "<a href=\"".$_SERVER['PHP_SELF']."?date="; if($month == 12){ $next_link .= mktime(0, 0, 0, 1, $day, ($year + 1)); } else { $next_link .= mktime(0, 0, 0, ($month +1), $day, $year); } $next_link .= "\">Next >></a>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/241521-refresh-calendar-without-refreshing-whole-page/ Share on other sites More sharing options...
westis4me Posted July 10, 2011 Share Posted July 10, 2011 I by no means know what I am talking about but, wouldn't an iframe work? Quote Link to comment https://forums.phpfreaks.com/topic/241521-refresh-calendar-without-refreshing-whole-page/#findComment-1240978 Share on other sites More sharing options...
cssfreakie Posted July 10, 2011 Share Posted July 10, 2011 You might want to have a look in something called AJAX An iframe could work too but ajax is much more cleaner. Quote Link to comment https://forums.phpfreaks.com/topic/241521-refresh-calendar-without-refreshing-whole-page/#findComment-1240993 Share on other sites More sharing options...
westis4me Posted July 10, 2011 Share Posted July 10, 2011 I wonder if you meant that to be a pun? AJAX Cleaner? Either way it made me laugh. Quote Link to comment https://forums.phpfreaks.com/topic/241521-refresh-calendar-without-refreshing-whole-page/#findComment-1240998 Share on other sites More sharing options...
cssfreakie Posted July 10, 2011 Share Posted July 10, 2011 ah the word cleaner caused a mind trick. http://en.wikipedia.org/wiki/Ajax_%28programming%29 have a look there, and once you read it try to expiriment with jquery ajax. we even have a forum for ajax here. Quote Link to comment https://forums.phpfreaks.com/topic/241521-refresh-calendar-without-refreshing-whole-page/#findComment-1241001 Share on other sites More sharing options...
teynon Posted July 11, 2011 Share Posted July 11, 2011 I agree ajax would be better. iframes have their own special uses. I like the fact that ajax is "more cleaner". Not just cleaner. Quote Link to comment https://forums.phpfreaks.com/topic/241521-refresh-calendar-without-refreshing-whole-page/#findComment-1241247 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.