This may be a good read to consider when doing this project.
http://www.devarticles.com/art/1/553
It is generally accepted that using javascript to submit forms can get pretty messy pretty quickly. If you intend to use this only for yourself or as a learning project of some sort you should be fine though.
<?
print $temp;
?>
<head>
<script>
function submit_me(form,val)
{
form.temp.value = val;
form.submit();
}
</script>
</head>
<body>
<form name=test action=<?=$PHP_SELF?>>
<input type=hidden name=temp>
<input type=button onclick=submit_me(test,"boo") value=Submit1>
<a href=javascript:submit_me(test,"Boo2")>Submit2</a>
</body>
It is worth noting that is most likely not cross-browser compatiable.
-Kaz