I need to capture user input on a web form and pass it to a script to create a user account but I cannot get it to work. so far I have a add_user.sh script that reads like this:
adduser -u $NAME -p $PASS -g users -s /bin/bash
but im not sure if that's going to capture user entered data from the web form?
You can build it into a string and then use exec If your server has it enabled
$str = 'adduser -u ' . $NAME . ' -p ' . $PASS . ' -g users -s /bin/bash';
exec(escapeshellcmd($str));
I should have probably noted before, many hosts disable this and any functions that perform command line commands for security reasons. Just because this exists doesn't make it a good idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With