If the PHP function is in the same script, how do I call it in "action" in a form? My code does not work. Thanks.
<?php
Function vote () {
echo "inside function vote";
echo "<br />";
if(isset($_POST['submitb'])) {
echo "inside if";
echo "<br />";
}
static $testvar = 0;
echo "assigned testvar as static, should be done once only -->";
echo $testvar;
echo "<br />";
$testvar++;
echo "increament of testvar, should be done everytime -->";
echo $testvar;
echo "<br />";
}
?>
<form method="post" action="<?php echo(htmlentities($_SERVER['PHP_SELF'])); ?>?vote" >
<input type="image" width=5% src="pix/camera.gif" name="submitb" value="submit" >
</form>
</body>
</html>