> I want to  get the  input of keyboard from php files,but i can't know how
to
> do.
>
> Who can tell me any advace about that?

If you want the input from the keyboard on the web-server machine (not the
client) you can use:

$file = fopen('php://input', 'r');
$char = fread($file, 1);

If you want keyboard input from a web browser client, you'll have to either:

Use JavaScript to capture the input, and then open up another HTTP
connection to a totally different PHP script to do something with it, or

Create a Java applet and Java servelet to have a keep-alive connection that
captures the browsers keystrokes and sends them back (via the Java servlet)
to PHP.

The first option will be dog-slow and completely un-usable for all but a
very limited class of solutions...

Keep in mind that PHP runs on the *SERVER*, and, in fact, your PHP script is
completely finished, dead, and gone by the time the user types a key.

If these options are unhelpful, tell us what you are actually trying to do
at a higher level.

Oh yeah:  For purely server-side shell-scripting keyboard cool-ness, I would
imagine that the new GTK-PHP combination would have some nifty stuff in
it...  Haven't even looked at it myself, and I don't even know GTK, so it
will be awhile before I can say anything more intelligent about it...  Not
that that always stops me :-)

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to