Simulate the Enter key in Unix with PHP
| From: | YoBro | Date: | Sat, 12 May 2001 05:32:28 +0000 |
| Subject: | Simulate the Enter key in Unix with PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52542@lists.php.net to get a copy of this message | ||
Hello,
I have been trying to get PHP to execute some code to add users to the
htpasswd file.
So far I have this
system ("htpasswd /users/website/.htpasswd jim");
My browser receives the unix data that reads : Adding user jim printed to
the browser.
Then you are usually prompted for a password in Unix, so the following is
the password I want to submit, but how do I tell it to simulate an ENTER key
press after each submission of the password.
system ("password"); // usually press enter after this
system ("password"); // and enter again.
I am hoping this will fix the problem. If it is beginning to add the user,
then it should work if I can execute the passwords with an ENTER after it as
well.
YoBro