It sounds like you're trying to use the same variable between page requests, but once a page finishes executing, variables are all released from memory.
You can use the session for this. The simplest way is to call session_start() at the top of your page, read the value from the session into a local variable, and then at the bottom of the page (or wherever you have the final value for this variable) put the current value of the variable back into session.
I also would suggest using more descriptive variable names. If this page gets bigger and bigger, variables named var1, var2, var3 are going to make less and less sense.
Are you putting these comments into a database somewhere? There might even be better ways of checking if a user is allowed to post a comment than just checking the number of times they've tried in the current session.