<?php
// Retrieve the data sent from the Flutter app
$field1 = $_POST['field1'];
$field2 = $_POST['field2'];
$option = $_POST['option'];
$value = $_POST['value'];

// Perform any necessary data validation or sanitization
// ...

// Connect to the database
$servername = "localhost";
$username = "marsalog_mahran";
$password = "gX-;hjZN-B*u";
$dbname = "marsalog_shipping_clearance_db";

$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Insert the data into the database
$sql = "INSERT INTO test_table (field1, field2, optio, value)
        VALUES ('$field1', '$field2', '$option', '$value')";

if ($conn->query($sql) === TRUE) {
    echo "Data inserted successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>