• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Accessibility in PHP

I want to implement hot keys in my website for accessibility reasons. How can I add hot keys using php code?
1 Solution
Hotkeys would be a client side function and only available in Javascript, Java, Flash or AJAX
You can use the html "accesskey" attribute <a href="index.php" accesskey="1">Home</a>
Php is a server side language you need to use javascript

If you are asking if you can have PHP respond to the key mapping then the answer is no. By the time that you see the webpage PHP has already performed all the work that it is going to. PHP is stateless therefore and cannot respond to changes in state.

The posts above are correct although they might have been a little more descriptive. There are several ways that PHP can help here, but essentiallly the client side scripting using DOM is pretty much the only way to do this. This means for the most part JavaScript, however VBScrips and some others could be used as well. BTW: Ajax is a form of JavaScript, Flash allows you to place a Flash Object which can have interactive controls that again use a Scripting Language called Action Script but will not respond to HTML Controls.

Remember all PHP will do for you here is generate the script code that appears in your web page when you view the source.

krutarth941Author Commented:
It was helpful
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now