How do I use a PHP5 variable inside a system() call
$dir = ‘/etc/somedir’;
eg system("ls $dir")
I think I’m missing something
I am actually passing a variable from a post
e.g.
$username = $_POST[username];
to a system call
system(“processData –user $username –pass $password”);
this isn’t working, so i trivialised down to a simple
example
You are doing it fine except that you are missing semi-colon (
;)You can also do like:
Note: