HTTP POST i cannot how

Hello there, i want to send temperature datas to database. My add.php have this code:

<?php
   	include("connect.php");
   	


	$temp=$_POST["temp"];

 $ins = mysqli_query($con,"INSERT INTO `tempLog` (`temperature`) VALUES ('".$temp."')") or die (mysqli_error($con));  	
   	

   	header("Location: index.php");
?>

Please i dont know how to send datas from Arduino. I got big problems with that. :frowning: Please send me code, which will working. I want Arduino in Client mode.
My .ino file:

#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 6
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "www.arduino.php5.sk";
IPAddress ip(192, 168, 1, 254);
EthernetClient client;
 int t = 0;  // TEMPERATURE VAR
 String data;
void setup() {
 Serial.begin(9600);
   sensors.begin();
 data = "1";
  t = (int) sensors.getTempCByIndex(0);
  
  while (!Serial) {
 }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Zlyhanie DHCP protokolu!");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("Priprájam...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("Pripojené");
    // Make a HTTP request:
    client.println("POST /add.php HTTP/1.1");
    client.println("Host: www.arduino.php5.sk"); 
    client.print(data);
    client.println();
    client.println("Pripojenie uzavreté");
    client.println();
  } else {
    // if you didn't get a connection to the server:
    Serial.println("Pripojenie neúspešné");
  }
}

void loop() {
  sensors.requestTemperatures(); 
  
  
    t = (int) sensors.getTempCByIndex(0); // Send the command to get temperatures
    data = t + "temp";
    delay(10000);
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
  
  Serial.println();
  delay(10000);
    Serial.println("Odpojené");
    client.stop();

    // do nothing forevermore:
    while (true);
  }
}

I want 2 temperatures, can you help me with that? I got Uno R3 (CH340) and Ethernet shield W5100. My temperature equipments are Dallas DS18B20

Why, exactly, is your temperature data top secret? A GET request is so much easier.

The POST data does NOT go immediately after the HOST statement. There must be a blank line. NOTHING follows the POST data.

And can you make this script .ino for me? Now i got that as PHP:

<?php
   	include("connect.php");
   	


	$temp1=$_GET["temp1"];
        $temp2=$_GET["temp2"];

 $ins = mysqli_query($con,"INSERT INTO `temp1Log` (`temperature`) VALUES ('".$temp1."')") or die (mysqli_error($con));
 $ins2 = mysqli_query($con,"INSERT INTO `temp2Log` (`temperature`) VALUES ('".$temp2."')") or die (mysqli_error($con));   	
   	

   	header("Location: index.php");
?>

But idk how to make .ino...
website: arduino.php5.sk
file for adding temeratures: add.php (CODE UPPER IS FROM THAT FILE)

     client.println("GET /add.php?temp1=xxx&temp2=xxxx HTTP/1.1");
    client.println("Host: arduino.php5.sk");
    client.println("User-Agent: Arduino/1.0");
    client.println("Connection: close");
    client.println();

should do the job - noticed the parameters are passed on the GET line itself. there is an example showing a simple web client - you need to base your work on this. in all honesty; you may want to look at your php code to prevent an SQL injection attack as well..

http://arduino.php5.sk/add.php?temp1=1&temp=2

you should hate to see something pass:

temp2=%3Bdrop%20table%20temp1Log%3B%20drop%20table%20temp2Log

but, i assume you'll take that into consideration.. you should never trust anything you receive on via HTTP.

http://bobby-tables.com/