[PHP] I want to get the input of keyboard
hi,all 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? Thx. -- 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]
Re: [PHP] I want to get the input of keyboard
""little boy"" <[EMAIL PROTECTED]> wrote in message 9h90pi$3ag$[EMAIL PROTECTED]">news:9h90pi$3ag$[EMAIL PROTECTED]... > hi,all > 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? > Thx. If you're running PHP as a server-side web scripting language, you can forget it. What you have to do is write an HTML form and process the returned data. If you need more interaction than that, look at JavaScript or Flash/ActionScript. -- 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]
Re: [PHP] I want to get the input of keyboard
something like that ""little boy"" <[EMAIL PROTECTED]> wrote in message 9h90pi$3ag$[EMAIL PROTECTED]">news:9h90pi$3ag$[EMAIL PROTECTED]... > hi,all > 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? > Thx. > > > > -- > 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] > -- 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]
Re: [PHP] I want to get the input of keyboard
> 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]
RE: [PHP] I want to get the input of keyboard
php://stdin php://stdout php://stderr are also for console input/output... > -Original Message- > From: Richard Lynch [mailto:[EMAIL PROTECTED]] > Subject: Re: [PHP] I want to get the input of keyboard > > $file = fopen('php://input', 'r'); > $char = fread($file, 1); > -- 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]