Page 1 of 1

Webserver won't redirect me

Posted: Thu Sep 14, 2023 6:13 pm
by HEINZGUENTER
Hello, i am writing a Dashboard for my ESP8266 and i have a Button that adds a Argument to the URL,
  1. <form style='display:inline-block;' method='post' action='/dashboard?delpasswd'><button style='display:inline-block;'>Delete Passwords</button></form>
when the Webserver has this Argument the clearPass Function is run.
  1. if (webServer.hasArg("delpasswd")){clearPass();}
  1. void clearPass(){
  2.   allPass = "";
  3.   passEnd = passStart; // Setting the password end location -> starting position.
  4.   EEPROM.write(passEnd, '\0');
  5.   EEPROM.commit();
  6.   webServer.sendHeader("Location", "/dashboard", true);
  7.   webServer.send(302);}
My Problem is the Redirect doesn't work, the Rest of the Function does but not the Redirect.