我无法弄清楚为什么......
这有效:
<?php
if($_POST['test']) echo "posted";
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="submit" name="test" />
</form>
Run Code Online (Sandbox Code Playgroud)
这不是:
<?php
if($_POST['test']) echo "posted";
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="image" name="test" src="images/button.submit.png" />
</form>
Run Code Online (Sandbox Code Playgroud)