Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

User Tag List

Likes Likes:  0
Results 1 to 3 of 3
  1. #1
    Graphics Guru

    Join Date
    Feb 2009
    Posts
    1,241
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    357

    How To Fix PHP Error Notice: Undefined variable: index”


    Register to remove this ad
    How To Fix PHP Error Notice: Undefined variable: index”


    Undefined index means that you are referencing an array index that doesn’t exist yet. It sounds like you aren’t passing header and Body as POST items.
    Undefined Index is just a notice, rather than an actual error. It’s bad form, but I turn notices off in php.ini. You can try adding this to your page to see if that stops the message:

    1. Open php.ini



    2. Make a change to this line

    Look for
    error_reporting = E_ALL

    comment out by adding a semicolon
    ;error_reporting = E_ALL
    OR

    replace the above line to
    error_reporting = E_ALL & ~E_NOTICE


    You can also supress notice errors by putting @ before the variable.

    PHP Code: @$variable = $_GET['a'];




    › See More: How To Fix PHP Error Notice: Undefined variable: index”



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Founder
    Apple's Avatar
    Join Date
    Jul 2008
    Location
    HeaveN
    Posts
    15,834
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    268
    Nice , thanks for sharing.





  4. #3
    Premium

    Join Date
    Nov 2012
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    7
    Reputation
    2

    Register to remove this ad
    Or you can actually fix those by actually takeing care if the variable is defined or not:

    if (isset($_GET['a'])){
    $variable = $_GET['a'];
    }

    This way you won't need to cheat by suppresing with '@' or disabling the error, that in my opinion can do rather bad than good when you're trying to debug.


 

 

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 04:09 PM.
Powered by vBulletin® Copyright ©2000-2019, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. User Alert System provided by Advanced User Tagging v3.3.0 (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org