Run command-line through PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
armadillo
Forum Newbie
Posts: 1
Joined: Thu Sep 25, 2008 5:40 am

Run command-line through PHP

Post by armadillo »

I need to do some command lines through a browser. What I need to do in a command-line would be:

Code: Select all

 
$login
<login name>
<password>
$passwd
<old password>
<new password>
<retype new password>
 
I've tried doing this with "shell_exec" but it doesn't work (because I need to input 5 parameters in the command-line.
So, how can I do this?

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Run command-line through PHP

Post by Christopher »

You can have as may parameters as you want. The exec functions are passed a string.

http://us2.php.net/manual/en/book.exec.php
(#10850)
Post Reply