SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Warnings!!

  1. #1
    SitePoint Member AMC's Avatar
    Join Date
    Jul 2001
    Location
    Sesimbra/Portugal
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Warnings!!

    I'm a beginner in PHP and mySQL and i'm starting to connect both, i'm programing a little php script.
    It's all going fine except for a warning of undefined variable.
    I don't have a way to define it so i was wondering if it's possible to disable the warning .

    Tks

  2. #2
    SitePoint Evangelist ucahg's Avatar
    Join Date
    Apr 2001
    Location
    Sarnia, Ontario, Canada
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    through an @ in front of it
    or disable E_NOTICES in php.ini

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Ann Arbor, MI
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should also be able to define the variable, using:

    var $foo

    I think that's correct... I'm a beginner at PHP as well.

    LL

  4. #4
    SitePoint Member AMC's Avatar
    Join Date
    Jul 2001
    Location
    Sesimbra/Portugal
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tks
    Works fine

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not common to have E_NOTICE on in setting error_notice within php.ini, on a production (live) server at least. And besides, you should/could eliminate the notices. For example :

    if (isset($var)) {

    echo $var;

    }

    As opposed to :

    echo $var;


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
  •