Is it possible to open and or close a program through a certain weblanguage?
system(), exec(), and passthru() in PHP, I'm not sure about other languages.
Thanks a lot maddox
in perl its command();
I have a similar question to this...in PHP...how can you start a process with certain environment variables?
Quote from: $t0rm on August 08, 2004, 10:49 AM
I have a similar question to this...in PHP...how can you start a process with certain environment variables?
A post (http://se.php.net/manual/en/function.exec.php) on a page at the php site says:
Quote
nehle at dragonball-se dot com
21-Oct-2003 11:59
Remember that some shell commands in *NIX needs you to set a TERM enviroment. For example:
<?php
exec('top n 1 b i', $top, $error );
echo nl2br(implode("\n",$top));
if ($error){
exec('/usr/bin/top n 1 b 2>&1', $error );
echo "Error: ";
exit($error[0]);
}
?>
This will echo "Error: TERM enviroment variable not set. " To fix it, add TERM=xterm (Or some other terminal) to the exec-statement, like this
<?php
exec('TERM=xterm /usr/bin/top n 1 b i', $top, $error );
echo nl2br(implode("\n",$top));
if ($error){
exec('TERM=xterm /usr/bin/top n 1 b 2>&1', $error );
echo "Error: ";
exit($error[0]);
}
?>