reading keyboard and interaction with os

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yandos

    reading keyboard and interaction with os

    Hello php gurus,

    maybe it sounds crazy, but I'd would like to use php for some system
    administration, backups, etc, but sometimes user interaction is needed.
    Till now i have been using windows script host, but more and more I need
    communication with intranet servers, which works fine with libcurl. Now
    I'm executing curl.exe for every intranet request I need, and it's too slow.

    My question is, if I can read keyboard using php. I know i can execute
    external program like choice.com (to ask for answer no/yes etc), but
    this is the thing i'd like to avoid... I know there's ton of other
    languges which could do that better, jike java or c++, but php is the
    only I know a bit.

    Thank you for any ideas,
    Y.
  • NC

    #2
    Re: reading keyboard and interaction with os

    Yandos wrote:[color=blue]
    >
    > My question is, if I can read keyboard using php.[/color]

    If you are running a command-line interpreter, yes; you can read
    keyboard input from standard input stream (STDIN):

    $response = trim(fgets(STDI N));

    Cheers,
    NC

    Comment

    • Yandos

      #3
      Re: reading keyboard and interaction with os

      "NC" <nc@iname.com > wrote in news:1132335121 .905963.215850
      @f14g2000cwb.go oglegroups.com:
      [color=blue]
      > Yandos wrote:[color=green]
      >>
      >> My question is, if I can read keyboard using php.[/color]
      >
      > If you are running a command-line interpreter, yes; you can read
      > keyboard input from standard input stream (STDIN):
      >
      > $response = trim(fgets(STDI N));
      >
      > Cheers,
      > NC
      >
      >[/color]

      That's great, thank you :)

      Y.

      Comment

      Working...