Q: ESP8266 disconnects immediately after connecting to server `I am new to ESP8266. 
I have created a website hosted on 000webhost, however whenever I connect to the server using the ESP8266's AT command set the connection closes instantly. I am trying to send some data from my Arduino board to the website via the ESP8266 
Therefore I can not send any message to the website.
Any ideas on how to handle this issue? Thanks!
Output on the serial monitor

Arduino Code
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);  //RX,TX




int LEDPIN = 13;

void setup() 
{
pinMode(LEDPIN, OUTPUT);

Serial.begin(9600);     // communication with the host computer
//while (!Serial)   { ; }

// Start the software serial for communication with the ESP8266
mySerial.begin(9600);  

Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println(""); 

}

void loop() 
{
digitalWrite(13,1);
// listen for communication from the ESP8266 and then write it to the serial 
monitor
if ( mySerial.available() )   {  Serial.write( mySerial.read() );  }

// listen for user input and send it to the ESP8266
if ( Serial.available() )      
// {  mySerial.write( mySerial.print("AT+CWMODE=1") );  }
{  mySerial.write( Serial.read() );  }

}

PHP Code:
<?php

if(isset($_GET['stat'])){
    $status=$_GET['stat'];
     $a2="<!DOCTYPE html><br><html><br>" . $status ."<br><html>";
   $fp = fopen("a2.php", "w");
  fwrite($fp, $a2);
  fclose($fp);

  echo $status;
  } 

  else {echo "house";}
  ?>

