Programming the script software

In the following code, we have a script that will communicate with the Arduino board, and it is installed on the server. You can now either copy the following code inside a file called parking.php, or get the complete code file from the folder for this project:

<?php
if (isset($_GET["model"]) && isset($_GET["plate"])) {
$temperature = intval($_GET["model"]);
$humidity = intval($_GET["plate"]);
$con=mysql_connect("localhost","root","ruben","arduinobd");
mysql_select_db('arduinobd',$con);
if(mysql_query("INSERT INTO data (model, plate)
VALUES ('$model', '$plate');")){
echo "Data were saved";
}
else {
echo "Fail the recorded data";
}
mysql_close($con);
}
?>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.12.240