Advertisement
dpDesignz

Verify.php KCTV

May 2nd, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. <?php
  2. // Flag variable for site status:
  3. define('LIVE', TRUE);
  4. // Admin contact address:
  5. define('EMAIL', 'email@example.com');
  6. // Site URL (base for all redirections. This is the address they will be redirected to if they try to access a protected page and they are not logged in.):
  7. define ('BASE_URL', 'http://www.example.com/online/login.php');
  8. // Location of the MySQL connection script:
  9. define ('MYSQL', 'db.php');
  10.  
  11. // Create the error handler:
  12. function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) {
  13.     // Build the error message.
  14.     $message = "<p>An error occurred in script '$e_file' on line $e_line: $e_message\n<br />"; 
  15.     // Add the date and time:
  16.     $message .= "Date/Time: " . date('n-j-Y H:i:s') . "\n<br />";  
  17.     // Append $e_vars to the $message:
  18.     $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n</p>";   
  19.     if (!LIVE) { // Development (print the error). 
  20.         echo '<div class="error">' . $message . '</div><br />';    
  21.     } else { // Don't show the error:  
  22.         // Send an email to the admin:
  23.         mail(EMAIL, 'Site Error!', $message, 'From: email@example.com');       
  24.         // Only print an error message if the error isn't a notice:
  25.         if ($e_number != E_NOTICE) {
  26.             echo '<div class="error">A system error occurred. We apologize for the inconvenience.</div><br />';
  27.         }
  28.     } // End of !LIVE IF.
  29. } // End of my_error_handler() definition.
  30. // Use my error handler.
  31. set_error_handler ('my_error_handler');
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement