-2

我想将它们格式化为表单中的按钮。

<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>
4

1 回答 1

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"> 
于 2013-08-20T21:01:25.127 回答