This can be done in php. You just set the action of the form to the same file. E.g. If the file is called index.php:
<form action="index.php" method=get>
<input type=submit name="vote" value="like">
<input type=submit name="vote" value="dislike">
If you do not want to use a form, you can simulate it with anchors:
In either case you need to allow for the url variable vote being NULL when index.php is first displayed.