Reputation: 1434
I need to add users to a local windows group via PHP. This is my attempt:
<?php
$output shell_exec('net localgroup groupname /add domain\user');
echo $output;
?>
I get Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\test\acc.php on line 2
. I suppose it's some escaping issue but I can't figure it out. Tried double backslash \\
but didn't help.
Upvotes: 2
Views: 460
Reputation: 5157
You forgot to assign the returned value to $output
variable
$output = shell_exec('net localgroup groupname /add domain\user');
Upvotes: 2