Better way to refresh a calendar

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
damian
Forum Newbie
Posts: 1
Joined: Mon Aug 31, 2009 12:25 pm

Better way to refresh a calendar

Post by damian »

Hi guys,
I've created a calendar here:

http://snow.byethost8.com/service/

I'm new to php but found the basic code for the calendar and modified it.

I'm just wondering if anyone can give me some advice regarding refreshing the dates when the user presses the previous month/next month links ('<' and '>').
I have it refreshing the entire page at the moment, which works but I was wondering if there is a better way? Some way I can just refresh the table that the calendar sits in?
Is php the way to go or would I be better doing some javascript?

Thanks for your help!
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Better way to refresh a calendar

Post by superdezign »

PHP cannot alter a page after it has already been loaded. JavaScript would be what you want.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Better way to refresh a calendar

Post by califdon »

Specifically, you want to refresh data on the page without reloading the entire page--that's called AJAX (Asynchronous Javascript And XML), which is a combination of Javascript in the browser and PHP (or other server script) at the server. Google for AJAX.
Post Reply