user27510: This is my arduino code for interfacing with an ESP8266:
#include <ESP8266WiFi.h>

int incomingByte;
String value;
char a;
int flag=0;
String valueserial;
int valueint;

const char* ssid     = "NIDHI";
const char* password = "nidhi123";

String data;

void setup() {
  Serial.begin(9600);
  delay(6000);
  data = "";
  valueserial = "";

//
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
 //
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);

    Serial.print(".");

  }
  //
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
//
}


void loop() {
  flag = 0;
  delay(5000);
  valueserial = "";
  // Use WiFiClient class to create TCP connections
  WiFiClient client;
String url = "/display.php";

if (Serial.available() > 0){
    while (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();
                valueserial += char(incomingByte);
              }
    if (incomingByte == '\n') {
      Serial.print("Value:");
      Serial.println(valueserial.toInt());
      Serial.print("String: ");
      Serial.println(valueserial);
      // clear the string for new input:
    }
    //valueint = Serial.parseInt();
    data = "?value=" + String(valueserial.toInt());

    url += data;
    delay(100);
    flag = 1;
}

if (client.connect("www.soil.pixub.com",80) && flag==1) { // REPLACE WITH YOUR SERVER ADDRESS
    client.print(String("GET ") + url + " HTTP/1.1\r\n" +
    "Host: soil.pixub.com\r\n" + 
    "Connection: close\r\n\r\n");
    Serial.println("!!!!DATA POSTED!!!!");
   } 

       //valueserial += '\0';
  //valueserial = Serial.read();
//  
Serial.println(data); 
//
  if (client.connected()) { 
    client.stop();  // DISCONNECT FROM THE SERVER
  }
//  
  Serial.println();
  Serial.println("closing connection");
//
}

And i am getting the following errors
Arduino: 1.6.12 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\Akshay\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:33:0,

                 from C:\Users\Akshay\Downloads\esp8266code\esp8266code.ino:3:

C:\Users\Akshay\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiType.h:26:19: fatal error: queue.h: No such file or directory

 #include <queue.h>

                   ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


user23645: The ESP8266WiFi library is meant to be used when programming an ESP8266 using the Arduino environment. In Arduino lingo: It's supposed to be used with a ESP8266 Board.
It's -not- meant to be used with a 'Arduino/Genuino Uno' board, which is what you are trying to do. This is why it fails.
What you want to use is the ESP8266wifi library, which is used with a ESP8266 connected to a Arduino, and flashed with AT firmware.
And yes, it's confusing, there are two very similar libraries:

Programming an ESP8266 using Arduino IDE:
ESP8266WiFi: https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi
Programming an Arduino using Arduino IDE, to communicate with ESP8266 using AT commands:
ESP8266wifi: https://github.com/ekstrand/ESP8266wifi


27510: <p>This is my arduino code for interfacing with an ESP8266:</p>

<pre><code>#include &lt;ESP8266WiFi.h&gt;

int incomingByte;
String value;
char a;
int flag=0;
String valueserial;
int valueint;

const char* ssid     = "NIDHI";
const char* password = "nidhi123";

String data;

void setup() {
  Serial.begin(9600);
  delay(6000);
  data = "";
  valueserial = "";

//
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
 //
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);

    Serial.print(".");

  }
  //
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
//
}


void loop() {
  flag = 0;
  delay(5000);
  valueserial = "";
  // Use WiFiClient class to create TCP connections
  WiFiClient client;
String url = "/display.php";

if (Serial.available() &gt; 0){
    while (Serial.available() &gt; 0) {
                // read the incoming byte:
                incomingByte = Serial.read();
                valueserial += char(incomingByte);
              }
    if (incomingByte == '\n') {
      Serial.print("Value:");
      Serial.println(valueserial.toInt());
      Serial.print("String: ");
      Serial.println(valueserial);
      // clear the string for new input:
    }
    //valueint = Serial.parseInt();
    data = "?value=" + String(valueserial.toInt());

    url += data;
    delay(100);
    flag = 1;
}

if (client.connect("www.soil.pixub.com",80) &amp;&amp; flag==1) { // REPLACE WITH YOUR SERVER ADDRESS
    client.print(String("GET ") + url + " HTTP/1.1\r\n" +
    "Host: soil.pixub.com\r\n" + 
    "Connection: close\r\n\r\n");
    Serial.println("!!!!DATA POSTED!!!!");
   } 

       //valueserial += '\0';
  //valueserial = Serial.read();
//  
Serial.println(data); 
//
  if (client.connected()) { 
    client.stop();  // DISCONNECT FROM THE SERVER
  }
//  
  Serial.println();
  Serial.println("closing connection");
//
}
</code></pre>

<p>And i am getting the following errors</p>

<pre><code>Arduino: 1.6.12 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\Akshay\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:33:0,

                 from C:\Users\Akshay\Downloads\esp8266code\esp8266code.ino:3:

C:\Users\Akshay\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiType.h:26:19: fatal error: queue.h: No such file or directory

 #include &lt;queue.h&gt;

                   ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -&gt; Preferences.
</code></pre>
 23645: <p>The ESP8266WiFi library is meant to be used when programming an ESP8266 using the Arduino environment. In Arduino lingo: It's supposed to be used with a ESP8266 Board.</p>

<p>It's -not- meant to be used with a 'Arduino/Genuino Uno' board, which is what you are trying to do. This is why it fails.</p>

<p>What you want to use is the ESP8266wifi library, which is used with a ESP8266 connected to a Arduino, and flashed with AT firmware.</p>

<p>And yes, it's confusing, there are two very similar libraries:</p>

<ul>
<li><p>Programming an ESP8266 using Arduino IDE:<br>
ESP8266<strong>WiFi</strong>: <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi" rel="nofollow noreferrer">https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi</a></p></li>
<li><p>Programming an Arduino using Arduino IDE, to communicate with ESP8266 using AT commands:<br>
ESP8266<strong>wifi</strong>: <a href="https://github.com/ekstrand/ESP8266wifi" rel="nofollow noreferrer">https://github.com/ekstrand/ESP8266wifi</a></p></li>
</ul>
