HTML in Arduino Rev4

I am trying to use the SimpleAP with a Uno R4.

Is there a slick way to get

<html>
<body>

<h1>The input element</h1>

<form action="/action_page.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="Submit">
</form>

<p>Click the "Submit" button and the form-data will be sent to a page on the 
server called "action_page.php".</p>

</body>
</html>

to something in the IDE that can be Client.print(html);

The HTML overtakes the program.

Thoughts?

What is SimpleAP ?

The simplest way that I have found to embed HTML code into an Arduino sketch is to use a raw string

An example

const char * myHTML = R"(
<html>
<body>

<h1>The input element</h1>

<form action="/action_page.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="Submit">
</form>

<p>Click the "Submit" button and the form-data will be sent to a page on the 
server called "action_page.php".</p>

</body>
</html>)";


void setup() 
{
	Serial.begin(115200);
  Serial.println(myHTML);

}

void loop() 
{

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.