when using this more then once in a script i get errors
even though the file pointers are different.

echo "Artist: ";
$artist = fopen("php://stdin", "r");
echo fgets($artist, 64);
fclose($artist);
echo "\n";

echo "Album: ";
$album = fopen("php://stdin", "r");
echo fgets($album, 64);
fclose($album);
echo "\n";

---------------------------
Errors:

<b>Warning</b>:  fopen("php://stdin","r") - Bad file descriptor in 
<b>./addvinyl.php</b> on line <b>11</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in 
<b>./addvinyl.php</b> on line <b>12</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in 
<b>./addvinyl.php</b> on line <b>13</b><br>




<-----CoreComm-Internet-Services---http://core.com----->
(Jon Marshall                 CoreComm Services Chicago)
([EMAIL PROTECTED]         Systems Engineer II)
([EMAIL PROTECTED]                   Network Operations)
<-----Enthalpy.org-------------http://enthalpy.org----->
([EMAIL PROTECTED]             The World of Nothing)
<------------------------------------------------------>

On Mon, 9 Apr 2001, Jason Brooke wrote:

> $fp = fopen("php://stdin", "r");
> echo fgets($fp, 64); 
> fclose($fp);
> 
> ----- Original Message ----- 
> From: "enthalpy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 09, 2001 1:10 PM
> Subject: [PHP] Asking for input from shell?
> 
> 
> > 
> > anyone have sample code of how you can have a php script (cgi)
> > ask for input from the shell?
> > 
> > <-----CoreComm-Internet-Services---http://core.com----->
> > (Jon Marshall                 CoreComm Services Chicago)
> > ([EMAIL PROTECTED]         Systems Engineer II)
> > ([EMAIL PROTECTED]                   Network Operations)
> > <-----Enthalpy.org-------------http://enthalpy.org----->
> > ([EMAIL PROTECTED]             The World of Nothing)
> > <------------------------------------------------------>
> > 
> > 
> > -- 
> > 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]
> 
> 


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