Jump to content

find out if error when a file was included


jasonc

Recommended Posts

Say I have...

 

<?
echo("do something");
include("include_file.php");
echo("do something else");
?>

 

include_file.php

<?
$a_$string = "a string";
echo($a_string);
?>

 

I have put an error in the include_file.php  an extra $ in the variable name.

 

The first script would kick up an error that there is a problem with file  include_file.php  as line 3 or what ever the line may be.

 

How can I have it so I can choose what the error message is, say a cryptic code and the line number without having the file names show as this is showing up my hidden includes folder and the file name which means that someone may try to visit this page alone and this can cause security issues.

 

Adding in extra lines to every file to see if it is being use correctly a bit like sessions is not an option although I have looked at it as I have houndreds of files to alter in this case.

 

 

I have just tried this instead of the top script but I does not show the secret code on error

<?
echo("top");
@include("dummy.php") or die("secreterrorcode123");
echo("bottom");
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.