PHP does not work like C/C++. When a page refreshes its previous state is gone, it has no knowledge of what happened before. You must save variables if you want to carry them across pageloads with either a database, sessions, cookies or files.
ShawnCplus
Code Monkey
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 268
You need JavaScript (unless you're comfortable with the page reloading on each change).
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137