Hey guys!
I'm trying to get my arduino to send a temperature variable to a server.
The variable is that 'TEMPr' in my code.
Can anyone see what is wrong?
code running on arduino:
Code:
if (client.connect(serverName, 80)) {
// Serial.println("connecting...");
// send the HTTP PUT request:
client.print("GET http://varano.eu.pn/arduino.php?t=");
client.print(TEMPr);
client.println(" HTTP/1.0");
// client.println("Host: www.arduino.cc");
// client.println("User-Agent: arduino-ethernet");
// client.println("Connection: close");
client.println();
}
server's php code
Code:
<?php
// ARDUINO TO WEB SERVER
$t = $_GET['t'];
file_put_contents('arduino-temp.txt', '<'.$t.'.0'.'>');
//return 'ok'; //dont really know how to use the return with arduino
?>