I tryam trying to send a data via GET to my PHP server from my Ethernet Shield2.
This is a part of my sketch:
char myserver[] = "www.myserver.com/";
if (client.connect(myserver, 80))
{
Serial.print("Connected to ");
Serial.println(myserver);
client.print("GET /arduino/controller.php?");
client.print("air_temp=");
client.print(DS18B20_temperature);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(myserver);
client.println("Connection: close");
client.println();
client.println();
}
else
{
// if you didn't get a connection to the server:
Serial.println("Connection failed to Server");
}
char myserver[] = "www.myserver.com/";
if (client.connect(myserver, 80)) {
Serial.print("Connected to ");
Serial.println(myserver);
client.print("GET /arduino/controller.php?");
client.print("air_temp=");
client.print(DS18B20_temperature);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(myserver);
client.println("Connection: close");
client.println();
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("Connection failed to Server");
}
The serial monitor displays "Connect to myserver.com" but my PHP code seemsdoesn't seem to not receive air_tempthe air_temp value from DS18B20_temperature. I checkchecked this value andand it's true.
However
However, when I try myserver.com/arduino/controller.php?air_temp=25myserver.com/arduino/controller.php?air_temp=25 in my browser, the phpPHP code is running well.
What's going wrong with my sketch code ?