Example of a two button form

Name :



Code for the form

<form  method="post" action= "action.php">

Name : <input type="text" name="name" size="30" value="" maxlength="60"/><br /><br />

<input type="submit" value="b1" name="action" />

<input type="submit" value="b2" name="action" /><br /><br />

</form>

The PHP script "action.php"

<?php

echo "<h1> Hello $name </h1>";

if ($action == "b1")
echo "you just clicked button 1";
if ($action == "b2")
echo "you just clicked button 2";

?>