In brief: is it possible to have multiple submit buttons on a page, and to detect on the receiving page which submit button was clicked?
For example, imagine a page that displays a random movie poster. There are two buttons: "I liked it", "I hated it." When either button is clicked, the form is submitted via POST to itself, where the user's like/dislike is noted in the database before displaying a new random poster.
My instinct was to write
<form action="thispage.php" method="post">
<input type="submit" name="like" value="I liked this." />
<input type="submit" name="dislike" value="I hated this." />
</form>
And then, on the receiving page,
if ($_POST['like'] == 1) ...
But that didn't work. Nor did
if ($_POST['submit'] == "like") ...
So I'm not sure what to do. Can anyone offer me a tip?