How to connect Arduino with ESP8266-11 WiFi module to 000webhost (free webhosting) I want to know how to connect my Arduino to my website on 000webhost.com (free webhosting account). I'm using ESP-11 WiFi module and it is connected to the internet.

This is my Arduino code:

#include &lt;SoftwareSerial.h&gt;
SoftwareSerial ESP11 = SoftwareSerial(10,11); // RX, TX
#define DEBUG true

// WIFI SHIELD DECLARATION
String ssid = "\"SampleSSID\"";
String pass = "\"SamplePass\"";
String tcp = "\"TCP\"";
String remoteip = "\"jvystocksystem.000webhostapp.com\"";
String portnum = "80";

void setup(){          
  ESP11.begin(9600);
  Serial.begin(9600);
  sendData("AT+CWMODE=1\r\n",2000,DEBUG); // configure as access point and Client
  sendData("AT+RST\r\n",2000,DEBUG); // reset module
  sendData("AT+GMR\r\n",2000,DEBUG); // View version Info
  sendData("AT+CWLAP\r\n",5000,DEBUG); // List all available AP's*/
  sendData("AT+CWJAP=" + ssid + "," + pass + "\r\n",10000,DEBUG); // Connect to AP
  sendData("AT+CIFSR\r\n",2000,DEBUG); // get ip address
  sendData("AT+CIPMUX=0\r\n",2000,DEBUG); //Single TCP Connections 
  sendData("AT+CIPSTART="+ tcp +"," + remoteip + "," + portnum + "\r\n",3000,DEBUG); // Start connecting to localhost &lt;link id&gt;,&lt;type&gt;,&lt;remote IP&gt;,&lt;Port Number&gt;

  String getStr = "GET /getCpno.php?user_type=admin HTTP/1.0"; // Getting info from my online database through my online website
  getStr += "\r\n\r\n";
  String cmd;
  // send data length
  cmd = "AT+CIPSEND=";
  cmd += String(getStr.length());
  sendData(cmd + "\r\n",1000,DEBUG);
  sendData(getStr,3000,DEBUG);
}


void loop() {
  // put your main code here, to run repeatedly:
// For ESP8266
  if(ESP11.available()) // check if the esp is sending a message 
  {


    if(ESP11.find("+IPD,"))
    {
     delay(1000); // wait for the serial buffer to fill up (read all the serial data)
     // get the connection id so that we can then disconnect
     int connectionId = ESP11.read()-48; // subtract 48 because the read() function returns 
                                           // the ASCII decimal value and 0 (the first decimal number) starts at 48

     ESP11.find("pin="); // advance cursor to "pin="

     int pinNumber = (ESP11.read()-48)*10; // get first number i.e. if the pin 13 then the 1st number is 1, then multiply to get 10
     pinNumber += (ESP11.read()-48); // get second number, i.e. if the pin number is 13 then the 2nd number is 3, then add to the first number

     digitalWrite(pinNumber, !digitalRead(pinNumber)); // toggle pin    

     // make close command
     String closeCommand = "AT+CIPCLOSE="; 
     closeCommand+=connectionId; // append connection id
     closeCommand+="\r\n";

     sendData(closeCommand,1000,DEBUG); // close connection
    }
  }
}

/*
* Name: sendData
* Description: Function used to send data to ESP8266.
* Params: command - the data/command to send; timeout - the time to wait for a response; debug - print to Serial window?(true = yes, false = no)
* Returns: The response from the esp8266 (if there is a reponse)
*/

String sendData(String command, const int timeout, boolean debug)
{

    String response = ""; // ESP8266 sendData String
    ESP11.print(command); // send the read character to the esp8266

    long int time = millis();

    while( (time+timeout) &gt; millis())
    {
      while(ESP11.available())
      {

        // The esp has data so display its output to the serial window 
        char c = ESP11.read(); // read the next character.
        response+=c;
      }  
    }

    if(debug)
    {
      Serial.print(response);

    }
    return response;
}


But my code is not returning the value I want from the database, instead I'm getting this in my serial monitor:



I hope you guys can help me with my code.
The web server is using virtual hosts. Unless you tell it to which virtual host are you making a request, the server won't know where to send the request and generate an error.

You need to add the required header Host, which tell it just that.

Make the proper request like this:

String getStr = "GET /getCpno.php?user_type=admin HTTP/1.1\r\n";
getStr += "Host: jvystocksystem.000webhostapp.com\r\n"; // add the required header
getStr += "\r\n";