vigour,
<script type="text/javascript">
function submitForm(value) {
var submitValue = document.getElementById('answer').value;
submitValue = value; // not needed to be 2 statements but clearer
document.form.submit();
}
</script>
<input type="hidden" name="answer" id="answer" value="" />
<a href="javascript:submitForm('yes');"/>Yes</a>
<a href="javascript:submitForm('no');"/>No</a>
Then check it with:
$answer = $_POST['answer'];
if ($answer == 'yes') {
echo "yes! thank you!";
} elseif ($answer == 'no') {
echo "oh no!";
} else {
echo "how did you submit this form??";
}
Note: You are then relying on Javascript, which as a whole is not a good idea.
Unless the form specifically REQUIRES javascript, I'd suggest styling the buttons in CSS to the best of your ability.