For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2007 > prompting the user on command line









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author prompting the user on command line
Jean Pierre Daviau

2007-02-13, 6:59 pm

Hi everyone,

Is there a way to prompt the user for input on the command line
apart from passing arguments at the start of the program?

Like
getchar() --- C
prompt("input", in) :---javascript
etc.


--
Thanks for your attention.

Jean Pierre Daviau
--
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp


Stuart Millington

2007-02-13, 6:59 pm

On Tue, 13 Feb 2007 15:53:05 -0500, "Jean Pierre Daviau"
<Once@WasEno.ugh> wrote:

>Is there a way to prompt the user for input on the command line
>apart from passing arguments at the start of the program?


Something like this?
http://www.sitepoint.com/article/php-command-line-1

1st entry from a Google on "php command line prompt" ;-)

--
------------------------------------------------------------------
- Stuart Millington ALL HTML e-mail rejected -
- mailto:phupp@dsv1.co.uk http://www.z-add.co.uk/ -
bob.chatman@gmail.com

2007-02-14, 6:59 pm

On Feb 13, 12:53 pm, "Jean Pierre Daviau" <O...@WasEno.ugh> wrote:
> Hi everyone,
>
> Is there a way to prompt the user for input on the command line
> apart from passing arguments at the start of the program?
>
> Like
> getchar() --- C
> prompt("input", in) :---javascript
> etc.
>
> --
> Thanks for your attention.
>
> Jean Pierre Daviau
> --
> windows Xp
> asus p4 s533/333/133
> Intel(R) Celeron (R) CPU 2.00 GHz
> Processor Radeon7000 0x5159 agp


Although not widely used, PHP is just as capable of being used as a
command line language as perl or python or C. The functions in PHP
work quite the same as the ones in the other languages. Here are a few
entries in the php.net documentation that will help you out.

http://us3.php.net/manual/en/function.sscanf.php
http://us3.php.net/manual/en/function.fgets.php
http://us3.php.net/manual/en/function.fgetc.php

http://us3.php.net/manual/en/features.commandline.php

Jean Pierre Daviau

2007-02-15, 6:59 pm

Thanks


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com