note 38693 added to function.popen

From: Date: Sat, 03 Jan 2004 05:33:14 +0000
Subject: note 38693 added to function.popen
Groups: php.notes 
Request: Send a blank email to php-notes+get-62842@lists.php.net to get a copy of this message
<?php $newuser = 'user1'; $UserPassword='foo12345'; $RootPassword='secret'; //execute the su command (RedHat-LINUX-9) $fp=popen("su -l -command=/usr/sbin/adduser $newuser;/usr/sbin/passwd $newuser","w"); // 1st line --> Input the Root Password (SU command) // 2nd line --> Input User Password (PASSWD command) // 3rd line --> Input User Password Again (PASSWD command) fwrite($fp,"\n$RootPassword\n$UserPassword\n$UserPassword\n"); pclose($fp); ?> But This script doesn't work to make a new user and password for new user. WHY???????? ---- Manual Page -- http://www.php.net/manual/en/function.popen.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38693 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38693&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38693&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62842) next »