Arduino Webserver each Autorefresh will execute the last command

Hi, I have this code, and it works except the fact that when I press one button and makes the autorefresh it will execute each time the last command. If I press “down” button to decrease the temperature setpoint, at each refresh it will degrease 1 unit.

How can I make it to make the refresh of the page without taking the last command?

Thank you

i Post only the server function

void loop() {
  ENET();
  slave.poll( au16data,16 );
  Compare();
   delay(30);
 
}

void ENET()
{ // Create a client connection
  EthernetClient client = server.available();
  if (client) {
      while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100) {
          //store characters to string 
          readString += c; 
          //Serial.print(c);
        } 
         //if HTTP request has ended
        if (c == '\n') {
               // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response

          client.println("Refresh: 2");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
           client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE>Solar Station</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");
          client.println("<H1>Solar Station </H1>");
               client.println("<input type=button value=UP onmousedown=location.href='/?up1;'>"); 
               client.println("<input type=button value=DOWN onmousedown=location.href='/?down1;'>");     
               client.println("&nbsp &nbsp &nbsp &nbsp  delta T Heating = "); 
               client.println(Hysteresis1);
               client.println("

"); 
               client.println("<input type=button value=UP onmousedown=location.href='/?up2;'>");
                client.println("<input type=button value=DOWN onmousedown=location.href='/?down2;'>"); 
               client.println("&nbsp &nbsp &nbsp &nbsp delta T Greenhouse = "); 
               client.println(Hysteresis2);
               client.println("

");
                       
               client.println("</BODY>");
               client.println("</HTML>");
         //  break;
          
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    
          if(readString.indexOf("up1") >0)
          {
             au16data[2]++;
          }
            if(readString.indexOf("down1") >0)
          {
             au16data[2]--;
          }
          if(readString.indexOf("up2") >0)
          {
             au16data[5]++;
          }
            if(readString.indexOf("down2") >0)
          {
             au16data[5]--;
          }
          //clearing string for next read
          readString="";
        }
      }
}}}

How can I make it to make the refresh of the page without taking the last command?

By providing the Refresh header only if you want a refresh of the current URL. If you encode the command in the URL you have to redirect to the main page in all cases where an action takes place. And only there you send a Refresh header.