1 回答

TA貢獻1858條經驗 獲得超8個贊
如果您只想將值保存到數據庫中,您可以使用全局變量$_POST作為
在同一個 php 文件中。
<form action="test.php" method="post" role="form" class="send-it-test">
<select class="form-control search-slt" name="selezione_sede">
<?php
$sql = "SELECT id,city,address FROM sedi ORDER BY city";
$ris = mysqli_query($db,$sql);
while($row = mysqli_fetch_array($ris)){
echo "<option value='" . $row['id']."'>" . $row['city'] ." ,". $row['address']."</option>";
}
?>
</select>
<div class="text-center">
<button type="submit" name="submit">Send</button>
</div>
</form>
<?php
if(isset($_POST['submit'])){
$value = $_POST['selezione_sede'];
}
?>
- 1 回答
- 0 關注
- 167 瀏覽
添加回答
舉報