A
Anonymous
Guest
Hi everyone, all is in the title. What i want is a web page programmed in php which allow me to execute a shell program when someone cliqued on a link. I tried to use the shell_exec and exec functions but the results aren't those expected. here is a sample i tried to see how to execute shell script in a php page:
when i access to the php page i only have "does it works?"
It's like i've found the solution with passthru :-D
<?php
function test() {
$path='var/html/test';
exec($path); //shell_exec($path);
//exec("exit(0)");
}
?>
<?php
echo "does it work?"
test();
?>
in the shell script test (i do chmod 755) there is
echo "yes it works"
when i access to the php page i only have "does it works?"
It's like i've found the solution with passthru :-D