Go Down

Topic: esp8266 POST problem how to return to home? (Read 344 times) previous topic - next topic

HoboHacker

HTML is not my bag.

But here goes.  Have almost everything working.
But when I do my submit, the url stays in the 192.168.1.25/submit

Hitting the back button works, but I need to to return without user intervention.

Using the ESP8266WebServer & page for the HTML

I've tired a (at the end of the handler):
Code: [Select]
handleRoot();
server.send ( 200, "text/html", getPage() );


but no joy.
What simple dumb nooby thing am I missing?

TIA
HH

PieterP

#1
Apr 09, 2018, 07:27 am Last Edit: Apr 09, 2018, 07:28 am by PieterP
Just use an HTTP redirect:
Code: [Select]
server.sendHeader("Location","/");        // Add a header to respond with a new location for the browser to go to the home page again
server.send(303);                         // Send it back to the browser with an HTTP status 303 (See Other) to redirect


Pieter

HoboHacker

Thank you Pieter!
Worked like a champ.
I owe you a beer!

HH

PieterP


ijd


Go Up