Wales wrote:They're radio buttons..I thought you can only do sql injections if you add text..? Like some kind of text box?
Yes, normally, but who says someone who's attempting to do a SQL injection is going to bother using your nicely made form to throw data at your PHP script? That's why you need to escape each and every piece of user-supplied data ($COOKIE, $GET, $POST, and even some indexes of $SERVER) to be protected.
As for your problem, that if statement doesn't really make sense (semantically, anyway), and I think you misunderstood greensweater (who I believe misunderstood the error at hand).
As I said, the message is echo'ed on each page load since your code doesn't check to see if $_POST['rate'] was even submitted yet or not. I also posted an example solution.
If for whatever reason you didn't want to follow the normal method of dividing the script into parts, you could change the else to an elseif and use [man]isset/man to verify that the variable was set.