我想将它们格式化为表单中的按钮。
<p><a href="<?=$_SERVER['PHP_SELF'] . "?action=moveForward" ?>">forward</a></p>
<p><a href="<?=$_SERVER['PHP_SELF'] . "?action=moveBackward" ?>">backward</a></p>
<p><a href="<?=$_SERVER['PHP_SELF'] . "?action=moveLeft" ?>">left</a></p>
<p><a href="<?=$_SERVER['PHP_SELF'] . "?action=moveRight" ?>">right</a></p>
像这样......
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
<input type="submit" name="moveForward" value="forward">
<input type="submit" name="moveBack" value="back">
<input type="submit" name="moveLeft" value="left">
<input type="submit" name="moveRight" value="right">
</form>
答案 0 :(得分:0)
<input type="submit" name="action" value="moveForward">
<input type="submit" name="action" value="moveBack">
<input type="submit" name="action" value="moveLeft">
<input type="submit" name="action" value="moveRight">