Forum Moderators: coopster
I have tried the following codes:
if (!(-e $script) ) {
print "Content-type: text/html\n\n";
print "Error";
exit(0);
} else {
require "$script";
-------------
eval "require '$script'";
print "Couldn't include $script: $@" if $@;
-------------
if (!include("$script")) { include("$error"); }
require("$wxbin_counter");
But both show eror messages
if !(-e "$script") {
print 'Error';
exit;
} else {
require "$script";
}
If you want to do this in PHP let us know. Otherwise, I'll ask the moderator to move this thread to the Perl Forum. regards -- coopster
Note: Prior to PHP 4.0.2, the following applies: require() [php.net] will always attempt to read the target file, even if the line it's on never executes.
if (file_exists($script)) {
print 'Error';
exit;
} else {
require $script; // you may want to use include [php.net] here instead.
}