I need to show the value of a String on a web-page instead of “ESP32 Login Page” text.
The String variable name is machineName.
The html code:
"<table width='20%' bgcolor='A09F9F' align='center'>"
"<center><font size=4><b>ESP32 Login Page</b></font></center>"
Often an escape character is used, so the sketch only needs to check if that escape character passes by.
On this page, scroll down to half-way, look at the index on the left, there are many webserver examples: 130+ ESP32 Projects, Tutorials and Guides with Arduino IDE | Random Nerd Tutorials. With the HTML code in the sketch or with a library or with a file.
Thanks for the answer.
But what is a escape character?
Could you show me a example?
A character that is not used in the HTML source code (or used a little).
For example: % or _
Followed by a number, a character or a text.
When the Arduino reads the HTML source code from a file or memory, then it checks for that and then it is replaced by something else. After that the Arduino sends the new HTML code to Ethernet or Wifi.
There are also libraries that do that for you.
Using a escape character and the Arduino fill in that part is a simple and basic solution. There are (too) many ways to make a webserver with an Arduino. For example: in combination with PHP; HTML5 has ‘canvas’ for a graphical live update; AJAX; JSON; and so on.
Have you seen \n or \r or \t in the ‘C’-language ? The escape character is the
The next character tells what it is.
\r is Carriage Return
\n is New Line
\r is Tab
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.