Problem with Refreshing a Webpage on Arduino webserver

Hello, i am trying to make a little Controll Box for my Garage Door, to see if its closed or not. And in Case of being Open to give shor impuls to a Relais for the Door Drive.
My code works fine until i hit the refresh button in my browser, than my output Pin will be triggered again.

I have used the example from the Webserver forum. I think the Prombelm must be in my Push Button HTML Code:

if (header.indexOf("GET /5/on") >= 0) {
output5State = "ON";
Trigger = "YES";
}

// Web Page Heading
client.println("

ESP8266 Web Server Garage

");

if (Trigger == "NO"){
client.println("

<a href="/5/on"><button class="button">ON

");
}

if (Trigger == "YES") {

Serial.println("GPIO 5 on");
//output5State = "ON";
Trigger = "NO";
digitalWrite(output5, HIGH);
delay(1000);
Serial.println("GPIO 5 OFF");
output5State = "OFF";
digitalWrite(output5, LOW);
client.println("

<a href=""><button class="button">ON

");

} else {
delay(1000);
Trigger = "NO";

The Problem is that in Browser Adress is still "/5/on" at the refresh an so my if statement is triggert. How could get it away ??

Regards Coolhand :o

Why are you using a string ("YES" or "NO") when a boolean is far more appropriate?

The Problem is that in Browser Adress is still "/5/on" at the refresh an so my if statement is triggert. How could get it away ??

Step 1: Post ALL of your code.