在原始查询中未显示任何结果后,我有一个通过 php 显示的表单。表单显示正常,但提交时会转到 index.php 而不是使用$_SERVER['PHP_SELF']
.
echo "<form method='post' action='". $_SERVER['PHP_SELF']."'>";
echo $error['find'];
echo "<p><label for='find'>Search for Your Favorite Location:</label><br />";
echo "<input type='text' id='find' name='find' value='".($_POST['find'] ? htmlentities($_POST['find']) : '')."' /></p>";
echo "<p><input type='submit' name='submitLocation' value='Submit' /></p></form>";