How to declare reactions with if statement in Javascript or PHP?

  • Thread starter Thread starter Ori-chan
  • Start date Start date
O

Ori-chan

Guest
I'm trying to find out a code for Javascript or PHP that will make something happened if certain keys are pressed. I'm sure it can be done with an if statement (it's how I would do it) but I don't know much about Javascript, so I'm looking for some assistance.

I'll give an example: go to http://gamespot.com . On your keyboard, enter the Konami Code (up up down down left right left right b a) then enter and this will take you to the page with Contra Cheat codes.

Thanks in advance.
 
PHP will not do it because PHP is strictly server side only. You can intercept keyboard presses in Javascript and the link shows you how to set this up.
 
Back
Top