<?php
$servername = "localhost";
$username = "xxxxxxxxxxxxxxxxxx";
$password = "xxxxxxxxxxxxxxxxxxxxxx";
$dbname = "xxxxxxxxxxxxxxxxxxxxx";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connessione fallita: " . $conn->connect_error);
}
$stmt = $conn->prepare("INSERT INTO tb01(ms_gpt_01_01, ms_gpt_01_02, ms_gpt_01_03, ms_gpt_01_04, ms_gpt_01_05, ms_gpt_01_06, ms_gpt_01_07) VALUES (?,?,?,?,?,?,?)");
$stmt->bind_param($ms_gpt_01_01, $ms_gpt_01_02, $ms_gpt_01_03, $ms_gpt_01_04, $ms_gpt_01_05, $ms_gpt_01_06, $ms_gpt_01_07);
if (isset($_POST['ms_gpt_01_01']) && isset($_POST['ms_gpt_01_02']) && isset($_POST['ms_gpt_01_03']) && isset($_POST['ms_gpt_01_04']) && isset($_POST['ms_gpt_01_05']) && isset($_POST['ms_gpt_01_06']) && isset($_POST['ms_gpt_01_07'])) {
$ms_gpt_01_01 = htmlspecialchars($_POST['ms_gpt_01_01']);
$ms_gpt_01_02 = htmlspecialchars($_POST['ms_gpt_01_02']);
$ms_gpt_01_03 = htmlspecialchars($_POST['ms_gpt_01_03']);
$ms_gpt_01_04 = htmlspecialchars($_POST['ms_gpt_01_04']);
$ms_gpt_01_05 = htmlspecialchars($_POST['ms_gpt_01_05']);
$ms_gpt_01_06 = htmlspecialchars($_POST['ms_gpt_01_06']);
$ms_gpt_01_07 = htmlspecialchars($_POST['ms_gpt_01_07']);
if ($stmt->execute()) {
echo "Record inserito con successo";
} else {
echo "Errore nell'inserimento del record: " . $stmt->error;
}
}
$stmt->close();
$conn->close();
?>