Version2: JS or Full PHP, it's a matter of choice