HELP !! Problem with Arduino and ethernet shield ... Arduino - PHP - PHPMYADMIN

Hi everyone … I have a problem … I want to send the temptations detected by the TMP 36 sensor from arduino to a web server (in my apache case) and thanks to a php script I want to register them in a database …
I’m using a virtual machine with windows 7 ultimate…
The problem is that arduino sends a GET request but the php script fails to fetch data from the string … I’m using XAMPP … Thank you in advance

WebClient.ino (2.33 KB)

etwini:
Hi everyone ... I have a problem ... I want to send the temptations detected by the TMP 36 sensor from arduino to a web server (in my apache case) and thanks to a php script I want to register them in a database ...
I'm using a virtual machine with windows 7 ultimate...
The problem is that arduino sends a GET request but the php script fails to fetch data from the string ... I'm using XAMPP ... Thank you in advance

Your get request is malformed.

You are aborting the client(client.stop()).

if (client.connect(ipw, 80))
{
Serial.println("Connesso");
//HttpClient client;
//client.get("http://192.168.1.100:8080/WebClient/temp.php?valore=25%20&localita=Molfetta");
//creo l'url utilizzanso una stringa
//strURL = "GET /temp.php?valore=25&localita=Molfetta HTTP/1.1";
//strURL +=temp;
//strURL +="&localita=";
//strURL += localita;
//strURL += " HTTP/1.1";
//Serial.println(strURL);
//invio la richiesta al server
//client.println(strURL); 
//client.print("Host: "); 
//client.println(server); 
//client.println("Connection: close"); 
//client.println();
//chiudo la connessione client.stop();
//client.stop();
////////

Change this from a print() to a println()

client.print( "GET /temp.php?valore=25&localita=Molfetta HTTP/1.0");

change this from a println() to a print()

client.println( "Host: ");

Change this from a print() to a println()

client.print(ipw);
//client.println("User-Agent: arduino-ethernet");
client.println( "Connection: close" );
client.println();

Change from client.stop() to client.flush()

client.stop();

}
else
{
Serial.println("Errore Connessione");
}
 
while(client.available())
{
char c = client.read();
Serial.print(c);
}
 
if (!client.connected())
{
Serial.println();
Serial.println("Disconnesso.");
client.stop();
}
 
//esegui la richiesta ogni 5 secondi
delay(5000);
}

Try these changes.

Chuck.