esp8266 issues

Hello everyone,

I would appreciate any help, thank you in advanced.

I am currently trying to send a GET request to a page on my website which will contain sensor data from an MBED device using an ESP8266 wifi module, I dont appear to be having any luck whatsoever with this and i have had multiple different errors ranging from bad requests** file has moved** timeout and the dreaded 404 not found. i have seen other forums cover this subject saying that its a security issue, however I can send a perfectly ok get request using google postman / a html request through my browser search bar.

The esp8266 sometimes responds with SEND OK but no data ever arrives in my test file or MySQL database.

What id like to know is, does anyone have a solution for this or has experienced the same problem, also is this the correct format for starting the host:


or is it simply

and is this the correct way to do the GET request:

GET /test.php?somedata1=1&somedata2=2

or is it /

(the above commands are examples only based on the code)

This is my php script:

<?php $var1= $_GET['somedata1']; $var2= $_GET['somedata2']; $fileContent="received f=".$var1."p=".$var2."\r"; $fileSatus = file_put_contents('myfile.txt', $fileContent,FILE_APPEND); if($fileSatus!=false){ echo "success"; }else{ echo "fail"; } ?>

this is my C++ code:

char SERVER[100]="“TCP”,“”,80\r\n";
char GET[100] = “GET /test.php?somedata1=1&somedata2=2”;

int main()
esp01.attach(&esp01_recv, Serial::RxIrq);
while(1) {


Some addittional information :

The AT+CIPSTART COMMAND in the C++ code returns OK and then 4 seconds after the word “CLOSED” appears.

If anyone could tell me what im missing, that would be brilliant and again thank you. also in case your wondering why im asking about an Mbed based question here, the reason is because generally arduino forums have greater support than Mbed :D.