I am trying to create an html form in an esp8266 captive portal. I think the escape characters are messing it up.
I have tried everything I could find. I am using the backslash () to escape. I even tried using double quotes to escape ("). Nothing works.
/*Code above this*/
String responseHTML = ""
"<title>CaptivePortal</title>"
"<form action=\"website.com\" method=\"post\">"
"<label for=\"file\">Variable:</label>"
"<input type=\"text\" name=\"var\" />"
"<input type=\"submit\" />"
"</form>";
/*Code below this*/
I expect this to redirect you to website.com after filling out the form. This does not happen. The data does not get sent over. I have checked on website.com and everything is working there.
Change the method to \"get\". The POST method does something different and will not generally load a web page (though its exact behavior will depend on the browser).
Your web browser almost certainly has a debugger or web console in it that you can use to see exactly what the browser is receiving and sending and what the results are. That can help you debug this kind of problem.