1
我通過POST方法使用href鏈接提交表單。當我提交表單時,我無法獲得PHP變量的值。如何在使用href提交表單後在同一頁上獲取文本?
這裏是我的代碼
if(($_POST)) {
$users1 = $_POST['cityname'];
echo $users1;
echo "shakti";
}
<td align="center">
<form action="searchresult.php" method="POST">
<a href="#" style="text-decoration:none;" onclick="parentNode.submit();" name="an">
</form>
<?php echo $row['city']; ?>
<input type="text" value="<?php echo $row['city'];?>" name="cityname">
</a>
</td>
我怎樣才能實現我想要的輸出?
謝謝!