RE: [PHP] CLI through PHP
index.html FORM method=post action=adduser.php INPUT type=text name=pwBR INPUT type=text name=pw2BR INPUT type=submit name=submit valuye=submit /FORM adduser.php - ?php ...write $pw and $pw2 to database ? did you try to do this yourself yet? what were the results? -Original Message- From: Liam [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 4:51 PM To: [EMAIL PROTECTED] Subject: [PHP] CLI through PHP 14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI through PHP
Pipes. I've only had to do it with perl, so i have no idea what the syntax or function calls are with PHP, but i'm almost positive that PHP supports reading/writing to/from pipes. Liam wrote: 14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI through PHP
On Thu, 14 Mar 2002, Liam wrote: 14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Someone else has already posted an example of a form to collect the data and pass it to a script called adduser.php. In adduser.php you could try the exec() function to execute the adduser/useradd command, something like: exec(useradd -u $uid -g $gid -d $home_dir -s $shell -c 'comments' $user); Hope this helps, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php