PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i'm using a script that was an example in php.net somewhere on how to use "shell_exec()" basically i want to exec shell commands and capture the value and display it on the site
I'm sorry for the lack of information, yes I am using WinXP SP2 with IIS6. i've tried using the exec() i'm not sure if i used it correctly
<?
$result = exec('date');
echo $result;
?>
still generating errors
Should the "date" work if it's a built in function of cmd.exe? I thought that's how it should work, if it's a built in function, therefore it would execute. thanks for the help =)
oh i didn't know there was a function called date() i'm gonna look that up in php.net. also i want to learn how to run cmd commands thru php. i saw a vague description wich used that little
$result = shell_exec("date");
didn't explain anything much just said it would use the command interperter and display the date. was searching the foras.
i'm sorry i must be asking the question wrong but i would like to see an example of using php to capture information from a shell command and display it thru php. i got this from php.net
I did a cut and paste of and just added the echo $output; but the page displays nothing. sorry i probably misunderstanding, this is called the "backtick" fucntion yes?