0
我最近爲我的FRC團隊(FIRST Robotics團隊)做了一個快速的HTML表單來評估其他團隊和他們的機器人在比賽中。目前,表單提交給MySQL服務器,這是我們想要的,問題是,我們不會隨時連接到互聯網,所以我們希望能夠在本地存儲多種形式的信息,然後一次用戶有WiFi連接,他們將所有填好的表單轉儲到MySQL上。我在編程方面不是很有經驗,所以一個簡單的解決方案將是首選,但任何有效的東西將不勝感激。它的形式是當前狀態,可以發現:HTML表格本地存儲
www.avirez.com/scouting
的PHP是這樣的:
<?php
// Create connection
$con=mysqli_connect("sqlStuff","moreSQL","evenMore","lastOne");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO scouting_data (teamName, teamNumber, auto, truss, high, low, human, self, robotNotes, togethor, others, teamNotes)
VALUES
('$_POST[teamName]','$_POST[teamNumber]','$_POST[auto]','$_POST[truss]','$_POST[high]','$_POST[low]','$_POST[human]','$_POST[self]','$_POST[robotNotes]','$_POST[togethor]','$_POST[others]','$_POST[teamNotes]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
mail("[email protected]","New data submission","A form has been submitted to the FRC Scouting database","");
header("Location: thanks.html");
mysqli_close($con);
?>