URGENT: Index Not found error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eatyou@rediffmail.com

    URGENT: Index Not found error

    Hi all

    I have a php form which refers to variables like -

    $HTTP_POST_VARS
    $_GET
    $POST

    etc.

    What happens is that these variables are not recognized and i get the
    following error -

    PHP Notice: Undefined index: status in
    c:\inetpub\wwwr oot\sma\members \login.php on line 71

    here status is being referred to as :-

    $_GET['status']

    is there anything wrong with my php settings? The same code works fine
    on my ISPs web server.

    Please let me know why this is happenning and how to correct it - and
    its needed to be fixed asap.

    Thanks in advance

    EY

  • Michael Fesser

    #2
    Re: URGENT: Index Not found error

    .oO(eatyou@redi ffmail.com)
    [color=blue]
    >What happens is that these variables are not recognized and i get the
    >following error -
    >
    >PHP Notice: Undefined index: status in
    >c:\inetpub\www root\sma\member s\login.php on line 71[/color]

    When do you get this error/notice? A bit more code and some more
    explanations would be helpful.
    [color=blue]
    >here status is being referred to as :-
    >
    >$_GET['status']
    >
    >is there anything wrong with my php settings? The same code works fine
    >on my ISPs web server.[/color]

    Of course $_GET['status'] only exists if the page in question was called
    with an URL parameter of this name, e.g.

    example.com/foo?status=42

    or if a form was submitted with an input element named 'status'. If you
    call the page directly without any form or parameters then PHP will
    complain about the unknown index.

    Micha

    Comment

    • colyn

      #3
      Re: URGENT: Index Not found error

      Most instances of PHP, by default, have notices turned off. Most likely
      the case with your ISP. You can change your error settings in your ini
      file. The error you're getting is basically telling you that you have
      an undefined variable. Since PHP doesn't really care about undefined
      variables, it throws you a notice instead of a typical warning or fatal
      error. If you want to keep notices on for whatever reason, you'll have
      to put a condition around the undefined variables to check to see if
      they have a value.

      Comment

      • eatyou@rediffmail.com

        #4
        Re: URGENT: Index Not found error

        Thanks!

        The problem was i waz trying to use $_Session['xyz'] and before using
        this variable one has to call - session_start() !!

        without which session variables don't work. Ofcourse notices are turned
        on in the error reporting thus those messages!

        Now its fixed

        Cheers

        EY!

        colyn wrote:[color=blue]
        > Most instances of PHP, by default, have notices turned off. Most[/color]
        likely[color=blue]
        > the case with your ISP. You can change your error settings in your[/color]
        ini[color=blue]
        > file. The error you're getting is basically telling you that you have
        > an undefined variable. Since PHP doesn't really care about undefined
        > variables, it throws you a notice instead of a typical warning or[/color]
        fatal[color=blue]
        > error. If you want to keep notices on for whatever reason, you'll[/color]
        have[color=blue]
        > to put a condition around the undefined variables to check to see if
        > they have a value.[/color]

        Comment

        Working...