Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 6 of 6

This is a discussion on Error Reporting in the Shared & Semi-Dedicated forum
Does anyone know of a code snippet you can add to a php webpage that will hide error reporting? Not the php.ini file - but ...

  1. #1
    JPC Member
    Join Date
    Jan 2004
    Posts
    15

    Error Reporting

    Does anyone know of a code snippet you can add to a php webpage that will hide error reporting?

    Not the php.ini file - but a webpage?

    Any help would be appreciated!
    Thanks

  2. #2
    Smo
    Smo is offline
    JPC Addict
    Join Date
    Nov 2002
    Location
    Finland
    Posts
    218
    error_reporting(0);

    more info about it: http://fi2.php.net/manual/en/functio...-reporting.php

  3. #3
    JPC Member
    Join Date
    Jan 2004
    Posts
    15
    Thanks Smo I added the snippet and the error no longer shows.

  4. #4
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Be careful with that, though, because hiding warnings will probably make it harder for you to locate and fix real errors

  5. #5
    Smo
    Smo is offline
    JPC Addict
    Join Date
    Nov 2002
    Location
    Finland
    Posts
    218
    I'd probably use:
    error_reporting(E_ERROR | E_WARNING | E_PARSE);

    that should show the worst errors. e_notice is annoying..

  6. #6
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Originally posted by Smo
    e_notice is annoying..
    This is because you do not appreciate good advises

    Warnings are designed to draw your attention to potentially 'dangerous' points. If there is no problem, it's usually very easy to modify your code to make compiler/interpreter happy. Small price to pay, IMHO.

    And if there is only 1 bug on every 1000 warnings, it's still worth it in the long run

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •