Esp Read Value from web header.

Hello Guys!

I have problem with a reading value from webpage. i would like to read decimals only from page.
Some body can you help me!

He is the situation:

I got this from serial:

GET /action_page.php?ertek=32 HTTP/1.1

I would like to read and store the number (32) to int, its changeable between 1 to 1.000.000.

This is http: code for number:

client.println("

<input type="number" name="ertek" min="1" max="1000000">

");
client.println("

<input type="submit">

");
client.println("

<input type="reset">

");

I tired some method like this, but not worked!

if (header.indexOf("ertek=%d") > 0) {
Serial.print(ertek);
}

Some body can you help me how can I read from http? Thank you!

I may not have completely understood what you are attempting to do.

  1. You've obviously got a PHP/web server.
  2. It looks like you are trying to get information from the user so that a command can be issued to the PHP server
    GET /action_page.php?ertek=32 HTTP/1.1 (32 is an example number)
  3. You appear to be attempting to run an arduino web server to display a page (html form) which collects the information from the user for 2) above. The user enters the URL for this page in a browser and is presented with your page

Is that approximately right ?
If so, in principle it is not difficult. It is just unusual (but of course perfectly OK) for an application to involve 2 web servers.
To help find an appropriate example, state what Arduino / network connection (WLAN/Ethernet) you are using.
Do you want to relay the results from the PHP page back to the user once it has executed ?

6v6gt:
If so, in principle it is not difficult. It is just unusual (but of course perfectly OK) for an application to involve 2 web servers.

technically the Arduino runs a REST server in this case, not a Web server