<form method="post">
<input type=button onclick="this.form.action='a.php';this.form.submit()" value='a.php'>
<input type=button onclick="this.form.action='b.php';this.form.submit()" value='b.php'>
</form>