GET request not working, not updating my Database

The code works for Thingspeak but doesn't update my own hosted website at 000webhostapp.com


#include <SoftwareSerial.h>
SoftwareSerial ESP8266(2, 3); // Rx,  Tx
long writingTimer = 17; 
long startTime = 0;
long waitTime = 0;
boolean relay1_st = false; 
boolean relay2_st = false; 
unsigned char check_connection=0;
unsigned char times_check=0;
boolean error;
void setup()
{
Serial.begin(115200); 
ESP8266.begin(115200); 
startTime = millis(); 
ESP8266.println("AT+RST");
delay(2000);
Serial.println("Connecting to Wifi");
 while(check_connection==0)
{
  Serial.print(".");
ESP8266.print("AT+CWJAP=\"Moto G\",\"12348765\"\r\n");
ESP8266.setTimeout(5000);
if(ESP8266.find("WIFI CONNECTED\r\n")==1)
{
Serial.println("WIFI CONNECTED");
break;
}
times_check++;
if(times_check>3) 
{
times_check=0;
 Serial.println("Trying to Reconnect..");
}
}
}

void loop()
{
waitTime = millis()-startTime;   
if (waitTime > (writingTimer*1000)) 
{
  writeThingSpeak();
  startTime = millis();   
}
}


void writeThingSpeak(void)
{
startWebConnectionCMD();
String getStr = "GET /iotData.php?"
getStr += "soildata=1&raindata=1&motor=1&submit=Submit";
getStr += "\r\n\r\n";
GetThingspeakcmd(getStr); 
}

void startWebConnectionCMD(void)
{
ESP8266.flush();
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "shahayush.000webhostapp.com";//name of the webserver
cmd += "\",80";
ESP8266.println(cmd);
Serial.print("Start Commands: ");
Serial.println(cmd);

if(ESP8266.find("Error"))
{
  Serial.println("AT+CIPSTART error");
  return;
}
}

String GetThingspeakcmd(String getStr)
{
String cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
ESP8266.println(cmd);
Serial.println(cmd);

//  if(ESP8266.find(">"))
//  {
  ESP8266.print(getStr);
  Serial.println(getStr);
  delay(500);
  String messageBody = "";
  while (ESP8266.available()) 
  {
    String line = ESP8266.readStringUntil('\n');
    if (line.length() == 1) 
    { 
      messageBody = ESP8266.readStringUntil('\n');
    }
  }
  Serial.print("MessageBody received: ");
  Serial.println(messageBody);
  return messageBody;
//  }
//  else
//  {
//    ESP8266.println("AT+CIPCLOSE");     
//    Serial.println("AT+CIPCLOSE"); 
//  } 
}

if(isset($_GET['submit'])){
       date_default_timezone_set("Asia/Kolkata");
       $t = date("Y-m-d H:i:s");
       $soil = $_GET['soildata'];
       $rain = $_GET['raindata'];
       $motorStatus = $_GET['motor'];
       $sql= "INSERT INTO `iotdata`(`IoTID`, `Date_Time`, `Soil_Moisture`, `RainDrop`, `Motor_Status`) VALUES (1,'$t','$soil','$rain','$motorStatus');";
                   if (mysqli_query($conn, $sql)) {  
                       echo "Data Inserted Successfully";
                   } else {
                       echo "ERROR: Could not able to execute $sql. " . mysqli_error($conn);
                   }
   }

my php code

To put your code in a code box, use the </> icon in the far left of the post tool bar and paste your code between the two bracket sets that appear.

To go back and put your code in a code box, in the bottom right of your post, select "more" and click modify. When the modify post opens, high light your code and click the </> in the far left of the post tool bar. This will put you code in code brackets. Then save the changes.

You should read the "General Guidance..." at the top of the discussion list.

I've deleted your other cross-post @ayush-shah.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

I'm facing the same problem. Please post the solution here if you've solved it. It would be a massive help!

The OP has one post, months ago. It would be unusual to get a response from him at this point. You would be better off with your own thread with your code posted.