I'm trying to insert records in a MySQL DB, but I'm getting no values from the POST variable.
I can see a new record is being entered with a record ID, but 0 in the next and only cell in the table. The cell type is a Double in form.html.
I've hidden the submit button for design purposes. This is developed for a mobile experience.
upload.php
<?php
$con=mysqli_connect("localhost","user","password","DB");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$cal = mysqli_real_escape_string($con, $_POST['cali']);
$sql="INSERT INTO `calibration` (`Calibration`) VALUES ('$cal')";
echo $sql;
if (!mysqli_query($con,$sql)) {
die('Error: ' . mysqli_error($con));
}
echo "Calibration Complete!";
mysqli_close($con);
?>
form.html
<form enctype="text/plain" action="upload.php" method="POST">
<input type="text" name="cali" value="Please calibration value" onclick='javascript: this.value = ""' >
<input type="submit" style="margin-left: -1000px;">
</form>
Thank you in advance!