You could use PHP's referrer variable $_SERVER['HTTP_REFERER']
to check that the referring URL belongs to you. But you can't rely on this 100% because this information may not be sent, and as it's part of the HTTP header the user can modify it if they like.
Sessions, as suggested, may be a good way to go about doing this. I'd choose sessions over cookies because users can disable their cookies on your site - and cookies are editable by the users. Sessions can only be edited by someone with access to your server (shared hosting usually).
Also I disagree with the way that you're doing this. Currently you're relying on user's having JavaScript enabled in their browsers. Some users don't have it enabled, some user's browsers don't support it. Some users even disable page redirects like that.
Personally, rather than using two scripts, I'd use a single script something like:
<form action="rank.php" method="post">
<input type="submit" value="Vote up!" />
<input type="submit" value="Vote down!" />
</form>
In rank.php you detect which of the two buttons was pressed then run a function accordingly. You could use a session variable to store the ID of the item they'll be voting on and then read that ID from the session (make sure to escape it though) to ensure the ID can't be changed by the user at the last minute.
Hopefully that should give you some ideas.