Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

www.webdp.net, Event 9 IIS log failed to write entry, wwwxxx jeffs, Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, sed: -e expression #1, char 1: unterminated address regex, procmail + change subject, w2ksp4.exe download, /proc/kallsyms format

Links

XODOX
Impressum

#1: Keyboard input using command line PHP under Windows

Posted on 2008-01-20 23:26:41 by BDthatsme

I can't get any of the various examples of keyboard input to work
using command line PHP.

I have Windows XP Pro SP 2 and PHP 5.1.6 (cli) (built: Aug 23 2006
16:35:53).

I can't find any info about why it doesn't work, or a way that does
work. Any suggestions?

examples of attempted variations: (and I've tried others)

$psLine = fgets (STDIN, 1024); // phpa.php at http://david.acz.org/phpa/

stdin = fopen("php://stdin", "r"); // PHP_Shell-0.3.1
$l = fgets(stdin);

Report this message

#2: Re: Keyboard input using command line PHP under Windows

Posted on 2008-01-21 06:19:32 by Norman Peelman

BDthatsme wrote:
> I can't get any of the various examples of keyboard input to work
> using command line PHP.
>
> I have Windows XP Pro SP 2 and PHP 5.1.6 (cli) (built: Aug 23 2006
> 16:35:53).
>
> I can't find any info about why it doesn't work, or a way that does
> work. Any suggestions?
>
> examples of attempted variations: (and I've tried others)
>
> $psLine = fgets (STDIN, 1024); // phpa.php at http://david.acz.org/phpa/
>
> stdin = fopen("php://stdin", "r"); // PHP_Shell-0.3.1
> $l = fgets(stdin);

Under Windows you have to hit <ENTER> to complete the input. Windows
does not support character by character entry/processing without
installing ncurses. Even then i'm not positive but I think so. Thing is
you'll have to compile it yourself. I have found it works out of the box
under Linux but have not done much testing.

--
Norman
Registered Linux user #461062

Report this message

#3: Re: Keyboard input using command line PHP under Windows

Posted on 2008-01-23 02:08:42 by Daniel Klein

On Sun, 20 Jan 2008 14:26:41 -0800 (PST), BDthatsme
<bdggetcetc@donnelly-house.net> wrote:

>I can't get any of the various examples of keyboard input to work
>using command line PHP.
>
>I have Windows XP Pro SP 2 and PHP 5.1.6 (cli) (built: Aug 23 2006
>16:35:53).
>
>I can't find any info about why it doesn't work, or a way that does
>work. Any suggestions?
>
>examples of attempted variations: (and I've tried others)
>
>$psLine = fgets (STDIN, 1024); // phpa.php at http://david.acz.org/phpa/
>
>stdin = fopen("php://stdin", "r"); // PHP_Shell-0.3.1
>$l = fgets(stdin);

PHP variables must be prepended with a '$'. So change 'stdin' to
'$stdin' (in both places) and your last variation should work.

Daniel Klein

Report this message