我一直在扫描其他类似的问题,但我没有任何运气。
这是我现有的页面:http ://excelwrestling.com/dual.php
您会在网页上看到表单的底部三行相同,但每一行都有唯一的信息。我试图让用户选择每个框,然后当他们点击提交时,它将所有信息发送到数据库,每一行都是唯一的。
Here a sample of my html:
<select name="Weight">
<option value="Weight">Weight:</option>
<option value="100">100</option>
<option value="105">105</option>
<option value="115">115</option>
<option value="125">125</option>
<option value="135">135</option>
<option value="145">145</option>
<option value="152">152</option>
<option value="160">160</option>
<option value="175">175</option>
<option value="195">195</option>
<option value="HWT">HWT</option>
</select>
</select>
Here is the action file:
// Get values from form
$Pool=$_POST['Pool'];
$Round=$_POST['Round'];
$Team_1=$_POST['Team_1'];
$Team_2=$_POST['Team_2'];
$Mat=$_POST['Mat'];
$Name_1=$_POST['Name_1'];
$Name_2=$_POST['Name_2'];
$Score=$_POST['Score'];
$Winner=$_POST['Winner'];
$Finished=$_POST['Finished'];
// Insert data into mysql
$sql="INSERT INTO $tbl_name(Pool, Round, Team_1, Team_2, Mat, Weight, Name_1, Name_2, Score, Winner, Finished)
VALUES('$Pool','$Round','$Team_1','$Team_2','$Mat','$Weight','$Name_1','$Name_2','$Score','$Winner','$Finished')"
. implode ('$Pool','$Round','$Team_1','$Team_2','$Mat','$Weight','$Name_1','$Name_2','$Score','$Winner','$Finished',$query_row);