Sending data to web database

Hi, i was trying to send data from arduino Uno with ESP8255 to my mysql database on a webserver. I dont know where problem is. When I write mywebside.com in browser it saves data in database but it doesnt work from arduino.
Arduino code:

#include <OneWire.h>
#include <SPI.h>
#include <ESP8266WiFi.h>



const char* ssid = "id";
const char* password = "pas";
char host []= "myweb.com";
WiFiClient client;


void setup() {

  Serial.begin(115200);

  delay(10);
  delay(5000);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}



void loop() {
   if(client.connect(host, 80)){
       delay(1000);
       Serial.println("OK");
       client.print("GET http://myweb.com/logger.php/?value=");
       client.print("125");
       client.print(" HTTP/1.1\r\n");
       client.println("Host: www.myweb.com");
       client.println("Accept: text/html, application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
       client.println("Connection: close");
       client.println();
       client.stop();
       delay(5000);
       
   }
}

And here is my php code:

<?php 
$server = "localhost";
$user = "user";
$pass = "321";
$db = "data";
$mysqli = mysqli_connect($server, $user, $pass, $db); 
if($mysqli and isset($_GET['value'])){ 
$value = sanitize($_GET['value']);
$sql = "INSERT INTO data (value) VALUES (".$value.")"; 
$doSql = $mysqli->query($sql); 
if($doSql){ 
echo 'Done';
}
else{
echo 'Mistake';
}
}
else{
echo "Something wrong";
}
function sanitize($input){ 
$input = htmlspecialchars($input);
$input = htmlentities($input);
$input = strip_tags($input);
$input = trim($input);
return $input;
}
?>
client.print("GET http://myweb.com/logger.php/?value=");

The request line doesn't get the complete URL but only the local path part.

       client.println("Host: www.myweb.com");

If you change the relevant parts you should do it consequently. Is the host called "www.myweb.com" or "myweb.com". And no, that's not the same.

It's working i changed
This

client.print("GET http://myweb.com/logger.php/?value=");

to this

client.print("GET /logger.php/?value=")

And there was also some mistakes in spaces and those stuff :slight_smile: