My static variable got initialized everytime the function is called. Here's my code(simplied), thanks. -
<script>
function validate() {
return true;
}
</script>
<?php
vote();
Function vote () {
static $testvar = 1;
echo $testvar;
if ($testvar == 1) {
$testvar++;
echo $testvar;
}
}
echo '<td><input type="image" width=50% src="pix/camera.gif" name="submitb" value="'.$tripid.'" onClick="validate()"></td>';
?>