title: ESP8266 disconnects immediately after connecting to server
body: <p>`I am new to ESP8266. </p>
  
  <p>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 </p>
  
  <p>Therefore I can not send any message to the website.
  Any ideas on how to handle this issue? Thanks!</p>
  
  <p>Output on the serial monitor</p>
  
  <p><img src="https://i.stack.imgur.com/eYbbA.png" alt=""></p>
  
  <p>Arduino Code</p>
  
  <pre><code>#include &lt;SoftwareSerial.h&gt;
  
  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 &amp; 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() );  }
  
  }
  </code></pre>
  
  <p>PHP Code:</p>
  
  <pre><code>&lt;?php
  
  if(isset($_GET['stat'])){
      $status=$_GET['stat'];
       $a2="&lt;!DOCTYPE html&gt;&lt;br&gt;&lt;html&gt;&lt;br&gt;" . $status ."&lt;br&gt;&lt;html&gt;";
     $fp = fopen("a2.php", "w");
    fwrite($fp, $a2);
    fclose($fp);
  
    echo $status;
    } 
  
    else {echo "house";}
    ?&gt;
  </code></pre>