Originally Posted by NuperSatural
where should I start?
Start by learning Javscript!
And have a look at forum rule #1.5.
It is your responsibility to die() if necessary….. - PHP Manual
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.