error_handler gibt jetzt uebersichtlich SQL fehler aus
git-svn-id: svn://svn.cccv.de/engel-system@186 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
parent
5557ac1b4a
commit
02a7b492a8
|
@ -8,8 +8,24 @@
|
|||
// general error handler collecting all messages in an array
|
||||
function Error_Handler($error_number, $error_string, $error_file, $error_line, $error_context)
|
||||
{
|
||||
global $error_messages;
|
||||
array_push($error_messages, "Error Number: ".$error_number."\nError String: ".$error_string."\nError File: ".$error_file."\nError Line: ".$error_line."\n");
|
||||
global $error_messages, $con;
|
||||
|
||||
//SQL error genauer analysiert
|
||||
$Temp = "";
|
||||
foreach ($error_context as $k => $v )
|
||||
if( (strpos( "0$k", "sql") > 0) || (strpos( "0$k", "SQL") > 0))
|
||||
$Temp .= "Error Context: $k = $v\n";
|
||||
|
||||
if( (strpos( "0$error_string", "MySQL") > 0) )
|
||||
$Temp .= "Error MySQL: ". mysql_error($con). "\n";
|
||||
|
||||
//übergeben des arrays
|
||||
array_push( $error_messages, "Error Number: $error_number\n".
|
||||
"Error String: $error_string\n".
|
||||
"Error File: $error_file\n".
|
||||
"Error Line: $error_line\n".
|
||||
(strlen($Temp)? "$Temp": "")
|
||||
);
|
||||
}
|
||||
|
||||
// register error handler
|
||||
|
@ -32,23 +48,42 @@
|
|||
$message = "";
|
||||
foreach($error_messages as $value)
|
||||
$message .= $value."\n";
|
||||
$message .= "\n\n\n\n\n";
|
||||
$message .= "\n";
|
||||
|
||||
if( isset( $_POST))
|
||||
{
|
||||
foreach ($_POST as $k => $v )
|
||||
$message .= "_POST: $k = ". ( $k!="password"? $v : "???..."). "\n";
|
||||
$message .= "\n";
|
||||
}
|
||||
|
||||
if( isset( $_GET))
|
||||
{
|
||||
foreach ($_GET as $k => $v )
|
||||
$message .= "_GET: $k = $v\n";
|
||||
$message .= "\n";
|
||||
}
|
||||
|
||||
$message .= "\n\n";
|
||||
|
||||
if( isset( $_SESSION))
|
||||
{
|
||||
foreach ($_SESSION as $k => $v )
|
||||
$message .= "_SESSION: $k = $v\n";
|
||||
$message .= "\n";
|
||||
}
|
||||
|
||||
if( isset( $_SESSION['CVS']))
|
||||
{
|
||||
foreach ($_SESSION['CVS'] as $k => $v )
|
||||
if( strlen($k)>3 )
|
||||
$message .= "_SESSION['CVS']: $k = $v\n";
|
||||
$message .= "\n";
|
||||
}
|
||||
|
||||
foreach ($_SERVER as $k => $v )
|
||||
$message .= "_SERVER: $k = $v\n";
|
||||
if( isset( $_POST))
|
||||
foreach ($_POST as $k => $v )
|
||||
$message .= "_POST: $k = ". ( $k!="password"? $v : "???..."). "\n";
|
||||
if( isset( $_GET))
|
||||
foreach ($_GET as $k => $v )
|
||||
$message .= "_GET: $k = $v\n";
|
||||
if( strpos( "0$k", "SERVER_")==0)
|
||||
$message .= "_SERVER: $k = $v\n";
|
||||
|
||||
send_message($message);
|
||||
|
||||
|
|
Loading…
Reference in New Issue