Hi all,

anyone know if there's a similar way to read like the linux php://stdin on a
windows box? I've tried to run a simple script founded on phpbuilder.com
about a shell scripting and it seems to work in some way just for the first
"request" ...

This a "screenshoot" of my ms-dos window:

<screenshoot>
C:\Programmi\Apache Group\Apache\bin\php>php -q test.php

What is your first name? max

What is your last name? <font color=ff0000><br>
<b>Warning</b>:  fopen("php://stdin","r") - No error in <b>test.php</b> on
line
<b>38</b><br>
</font><font color=ff0000><br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in
<b>te
t.php</b> on line <b>39</b><br>
</font><font color=ff0000><br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in
<b>te
t.php</b> on line <b>40</b><br>
</font>

</screenshoot>

this is the code:

function read() {
    $fp=fopen("php://stdin", "r");
    $input=fgets($fp, 255);
    fclose($fp);
    return str_replace("\n", "", $input);
}
print("\nWhat is your first name? ");
$first_name = read();
print("\nWhat is your last name? ");
$last_name = read();
print("\n\n\nHello, $first_name $last_name!  Nice to meet !\n");


many thanks in advance
max


-- 
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