# Esp Read Value from web header.

**URL:** <https://forum.arduino.cc/t/esp-read-value-from-web-header/517686>\
**Category:** Programming\
**Created:** [April 1, 2018, 1:56pm UTC](https://forum.arduino.cc/t/esp-read-value-from-web-header/517686 "2018-04-01T13:56:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baggio1788](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@baggio1788](https://forum.arduino.cc/u/baggio1788)\
**Post date:** [April 1, 2018, 1:56pm UTC](https://forum.arduino.cc/t/esp-read-value-from-web-header/517686/1 "2018-04-01T13:56:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [April 2, 2018, 9:14am UTC](https://forum.arduino.cc/t/esp-read-value-from-web-header/517686/2 "2018-04-02T09:14:37Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [April 2, 2018, 10:27am UTC](https://forum.arduino.cc/t/esp-read-value-from-web-header/517686/3 "2018-04-02T10:27:33Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 11:06pm UTC](https://forum.arduino.cc/t/esp-read-value-from-web-header/517686/4 "2021-05-05T23:06:24Z")

</div>

Closed on May 5, 2021, 11:06pm UTC


