How do I do to make PHP say properly when a CGI script trigger by an exec does not exist ?
See: http://www.mejoresdatos.net/test.php
The code:
<?
ini_set('display_errors', 1);
error_reporting(E_ALL);
$filename="/tmp/log7337254988.txt";
if (file_exists($filename)) {
echo "The file $filename exists<br>";
} else {
echo "The file $filename does not exist<br>";
}
$cmdline = "xxxxxx.cgi $filename";
echo "The command line: $cmdline <br>";
exec($cmdline,$result,$retint);
if ($result[0]=="CORRECTO")
{
return 1;
}
else {
return 0;
}
?>