Incrementing a Variable
Posted: Mon Mar 06, 2006 9:41 am
hello, basic help needed, I was trying to make a code, that upon refresh, it would increment a variable by +1 each time. But it doesn't seem to quite work, i dont want to use any sessions or cookies with this.
Here's my code. any pointers?
Here's my code. any pointers?
Code: Select all
<?php
$inc = 0;
if ($inc != "20"){
$inc = $inc + 1;
}else{
$inc = 0;
}
?>
<input type="hidden" name="increment" value="<?php echo $inc; ?>" />