Thanks!

From: Richard Salin (richard.salin_at_kolumbus.fi)
Date: 10/16/04

  • Next message: J.O. Aho: "Re: Turn off PHP completely"
    Date: Sat, 16 Oct 2004 18:18:02 +0300
    
    

    The problem was in the php.ini file, the apace referece
    to the file was invalide, and therefor it used the default
    which was to display all errors including notices.
    - I'd also liked to thank for the "isset" notice, I wasn't aware of the
    command before this, and in my case it was
    actually the command to be used.

    Rez
    "Janwillem Borleffs" <jw@jwscripts.com> kirjoitti viestissä
    news:416ee3e3$0$41689$1b2cd167@news.euronet.nl...
    > [removed alt.php.sql because my news server cannot resolve this group]
    >
    > Richard Salin wrote:
    > > Hello!
    > > I'm using the newest version of php and apache, can't remember
    > > which. The problem is that it keeps giving notice messages for
    > > several reasons, for example if a varible doesn't exist (when checking
    > > variable!=null if the page has been displayed)
    > > -My questin is, how do I get it to stop? The script work just fine,
    > > except for the notices. With a older version of the apache and php
    > > it worked just fine.
    >
    > You can do this by adjusting the error_reporting level in the php.ini
    file,
    > in an .htaccess file or at page level by calling the equally named
    function.
    >
    > See the manual for details.
    >
    > However, notices indicate sloppy code. Instead of doing:
    >
    > if ($somevar == "somevalue") {
    > ..
    > }
    >
    > it's better practice to perform a proper validation, like:
    >
    > if (isset($somevar) && ($somevar == "somevalue")) {
    > ..
    > }
    >
    > Shure, it's more code, but you will be grateful to yourself the next time
    > you need to debug your code and will be learning yourself to code at a
    > higher level.
    >
    >
    > JW
    >
    >
    >


  • Next message: J.O. Aho: "Re: Turn off PHP completely"

    Relevant Pages

    • Re: [PHP] question about customized error
      ... not found or a 404 error message i would like to display a customized page ... Does this have to be done from apache perspective or can it be done using ... please suggest the procedure in either case apache OR php. ...
      (php.general)
    • Re: xampp installation
      ... I assume that this is not the reason for the php error on Apache ... several other dll. ... In fact IMHO there should be two but the command line one should be ...
      (comp.lang.php)
    • Serving Files with PHP
      ... I've used Apache with the automatic directory indexes ... ... just click on the file name and IE magically figures out how to display it ... Is it possible to do this with PHP? ...
      (comp.lang.php)
    • [opensuse] Apache, PHP works but the PHP extensions dont
      ... PHP functions normally from the command line, ... Previously I was running SUSE 10.1, and I've compared the setup and I ... its libraries when running from Apache? ...
      (SuSE)
    • Re: Error catching?
      ... experience with things like errorpages and apache etc. ... those pages are on a 'lower level' than the php parsing - lets say ... > Will it display whatever is in the else structure, ...
      (alt.php)