error_reporting(E_ALL ^ E_NOTICE); (PHP)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qw12er
    Confirmed User
    • Apr 2004
    • 799

    #1

    error_reporting(E_ALL ^ E_NOTICE); (PHP)

    I just did what I saw oin php.net to report display PHP's errors.

    I also tried 98345394 other variants but no luck.

    anybody knows how to displays error in PHP ? ( I don't have acces to files, I'm on Virtual Hosting for now)
    I have nothing to advertise ... yet.
  • lb_vee
    Confirmed User
    • May 2004
    • 886

    #2
    Can you maybe post some of your code??

    Comment

    • qw12er
      Confirmed User
      • Apr 2004
      • 799

      #3
      Well ...

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <title>Insert tcg</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      </head>

      <body bgcolor="C6C6C6" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
      <?

      error_reporting(E_ALL);

      then the rest of my code ...

      ?>
      I have nothing to advertise ... yet.

      Comment

      • qw12er
        Confirmed User
        • Apr 2004
        • 799

        #4
        All I get is a blank page ... (When I have an error in my code)
        I have nothing to advertise ... yet.

        Comment

        • calmlikeabomb
          Confirmed User
          • May 2004
          • 1323

          #5
          Hi,

          What you need is config.inc just save this code as config.inc and include at the top of your php pages.

          Code:
          <?php
          
          // This script sets the error reporting and logging for the site.
          
          //error_reporting (0); // Production level
          error_reporting (E_ALL); // Development level
          
          // Use my own error handling function.
          function my_error_handler ($e_number, $e_message, $e_file, $e_line) {
          
          	$message = 'An error occurred in script ' . $e_file . ' on line ' . $e_line . ": $e_message";
          	//error_log ($message, 1, '[email protected]'); // Production (send email)
          	echo '<font color="red">', $message, '</font>'; // Development (print the error in red)
          }
          set_error_handler('my_error_handler');
          ?>
          subarus.

          Comment

          • qw12er
            Confirmed User
            • Apr 2004
            • 799

            #6
            Thanks ! Working like a charm!!!
            I have nothing to advertise ... yet.

            Comment

            • calmlikeabomb
              Confirmed User
              • May 2004
              • 1323

              #7
              You're welcome bro.
              subarus.

              Comment

              Working...