Do you have a question? Post it now! No Registration Necessary. Now with pictures!
October 7, 2007, 3:46 pm
rate this thread
I have a script that takes two inputs from the keyboard to change some
settings on some equipment. I would usually run this as e.g.
new-setting 1 <enter>
Settings successfully changed
I want to automate this from a PHP script (it will be for my use only
with restricted access via .htaccess etc, so security is not a major
I can do system or exec("change-settings"); ok, but how do I 'enter'
the input from a php-script? The new-settings1 and 2 will be stored
in variables in PHP.
Re: Exec() and 'keyboard' input
Depending on your OS you could echo the variables in:
# change-settings < "settings 1", etc
brendan brendangillatt co uk
PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD7433
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
-----END PGP SIGNATURE-----
- » would it be more natural if it is "loopover ($arr as $value)"
- — Previous thread in » PHP Scripting Forum