Need help with some logic in my sketch.

It's an html submit type button. I'm using an AsyncLabs WiShield 2.0. The code looks confusing. I just don't know where to implement the checks / counts.

Code is above in the first post. Html from the WiShield:

<html>
<head><title>Door Opener</title></head>
<body>
<center>GARAGE DOOR OPENER<center>
<center>




<input type="submit" onclick="location='/?LED0'" value="Opener 1">Door Closed

<input type="submit" onclick="location='/?LED1'" value="Opener 2">Door Closed

<input type="submit" onclick="location='/?LED2'" value="Opener 3">Door Closed

</html>

And when you click one of the buttons the page refreshes and the status gets updated.