RE: [PHP] Newbie... Executing UNIX commands...
On 10-May-01 macky wrote: > im using PHP + APACHE on Linux Box > > i wonder what command in PHP can i use to execute Unix commands $foo=`ls` thats a "back-tick" Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- 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]
Re: [PHP] Newbie... Executing UNIX commands...
for your specific example, check out http://www.php.net/manual/en/function.readdir.php lots of simple functions like that have already been written for you...the joy of php ;-) -jack macky wrote: > > im using PHP + APACHE on Linux Box > > i wonder what command in PHP can i use to execute Unix commands > > i got to read also exec(), system(), passthru(),popen(), and > excapeshellcmd() > > but what if i want to use the command "ls" and store ALL output in a > variable > > i thought system() is enough but system function outputs the result on > the page... > > actual code: > <%php > $var = system("ls /tmp/"); > %> > > if u can see no "echo" command.. > > lastly is there a possibility that resulting output from "ls" will be placed > in a list... or array.(since PHP doesnt have list) > > : ( > > thanks in advance > > -- > -- > The information contained in this message (including any attachments) > is confidential and intended solely for the attention and use of the > named addressee(s). It must not be copied, distributed nor disclosed > to any person. If you are not the intended recipient, please delete > it from your system and notify sender immediately. Any disclosure, > copying or distribution thereof or any action taken or omitted to be > taken in reliance thereon is prohibited and may be unlawful. > -- > > -- > 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] Newbie... Executing UNIX commands...
im using PHP + APACHE on Linux Box i wonder what command in PHP can i use to execute Unix commands i got to read also exec(), system(), passthru(),popen(), and excapeshellcmd() but what if i want to use the command "ls" and store ALL output in a variable i thought system() is enough but system function outputs the result on the page... actual code: <%php $var = system("ls /tmp/"); %> if u can see no "echo" command.. lastly is there a possibility that resulting output from "ls" will be placed in a list... or array.(since PHP doesnt have list) : ( thanks in advance -- -- The information contained in this message (including any attachments) is confidential and intended solely for the attention and use of the named addressee(s). It must not be copied, distributed nor disclosed to any person. If you are not the intended recipient, please delete it from your system and notify sender immediately. Any disclosure, copying or distribution thereof or any action taken or omitted to be taken in reliance thereon is prohibited and may be unlawful. -- -- 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]