Check status of LED before refreshing webpage

Hi guys,

I have two LEDs on my Rabbit module circuit. My web interface can now on off my two LEDs with clicking the mouse.

However, if I were to go to my HyperTerminal programme to off my LED. When I do a refresh on my web interface page, it will not display the LED as turned off.

I am figuring out how to “tell” the web interface that my LED is actually ON and OFF whenever I do a refreshing of the page.

Do I need to create a new CGI script for this function?

Thanks alot guys!

void wbUpdIoStatus() //It is also known as wbUpdIoStatus.cgi
{
	if ( gioRelay( &ioAlarm1, Status ) == 1 )
	{
	   strcpy(led1,"ledon.gif");
	}
	else
	{
	   strcpy(led1,"ledoff.gif");
	}
	if ( gioRelay( &ioAlarm2, Status ) == 1 )
	{
	   strcpy(led2,"ledon.gif");
	}
	else
	{
	   strcpy(led2,"ledoff.gif");
	}
}

and under

tcpip.lib:

void tickWeb(void)    //this must be run in a endless loop
{
	wbUpdIoStatus(); //To update browser on status of LED
	tcp_tick(NULL);		// TODO no need cos http_handler is doing it ?
	http_handler();
}