Re: Asking for input from shell?

From: Date: Mon, 09 Apr 2001 07:59:35 +0000
Subject: Re: Asking for input from shell?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47741@lists.php.net to get a copy of this message
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) (jonathon.marshall@core.com Systems Engineer II) (enthalpy@core.com Network Operations) <-----Enthalpy.org-------------http://enthalpy.org-----> (enthalpy@enthalpy.org 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" <enthalpy@core.com> > To: <php-general@lists.php.net> > 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) > > (jonathon.marshall@core.com Systems Engineer II) > > (enthalpy@core.com Network Operations) > > > > <-----Enthalpy.org-------------http://enthalpy.org-----> > > (enthalpy@enthalpy.org The World of Nothing) > > <------------------------------------------------------> > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#47741) next »