as you all already know from my previous question I'm new in PHP(by the way,thanks again for the previous help),
I am trying to build a simple "walking" program,so I'll have "forwards",
"backeards","right" and "left" buttons and when I click on one of them the picture on the page will change.
I started with a simple variable expirement,I have one button on the page and when I click it I expect the variable to grow by 1(in the future that var will show a place inside an array),but from some reason the code doesn't work,here is the code:
<html> <body> <?php $array; $i=0;?> <BUTTON type="pushbutton" onClick="<?php $i++?>" ><img alt="Forwards"/ > </BUTTON> <?php echo"<br/>".$i ; ?> </body> </html>
The described array will be used later.
The problem with the code is that the printed variable value is always 1,
it doesn't equals 0 like it should before I push the button and it doesn't turn to 2 after I push the button.
Can please anyone tell me how to fix it.
And also,I have some C/C++ programing expirience,so maybe it gives me trouble when I try to program on php,any php profi advice about my project would be great.