So, friend, the way you want to do, using PHP, I don’t know if it’s possible, unless you pass an initial HTML value to PHP and make an ajax request for PHP to process this number, increment it in one and return to the view.
I don’t know what your purpose is and I don’t know if you really need to use PHP, but anyway I will post here a solution in javascript, it may be that give the result you want...
<html>
<form id = "formulario">
<input type = "submit" name = "Submit" value = "Go!">
<label id = "resultado">1</label>
</form>
<script type="text/javascript">
var i = 1;
$("#formulario").submit(function(e) {
e.preventDefault();
i++;
$("#resultado").html(i);
});
</script>
BS: I’m using jquery... stackoverflow won’t let you copy all the code, but I hope you understand...
It worked!!! Thanks boy! I believe that this way I will be able to implement in my original code! ;)
– Felipe