Undefined Index notices

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Morrison

    #1

    Undefined Index notices

    I'm getting this:

    [client 192.168.5.50] PHP Notice: Undefined index: D1 in
    /var/www/html.....

    From this line of code:

    $id_option = $_POST['D1'];

    Which is posted by this:

    <form target="_blank" method="POST" action="mailcha rt.php" name="mail_data ">
    <input type="hidden" name="D1" value="<? echo $id_option; ?>">
    <input type="submit" value="View Chart"></p>
    </form>

    My question is why?

    I *am* getting the correct value for $_POST['D1'] and at this point in
    time am really quite confused because that notice is getting thrown.

    [root@... ~]# php -v
    PHP 4.3.11 (cgi) (built: Nov 8 2005 06:24:40)

    [root@... /]# uname -a
    Linux ... 2.6.12-2.3.legacy_FC3 #1 Sun Feb 19 10:47:10 EST 2006 i686
    i686 i386 GNU/Linux

    Thanks..

    Craig
  • Markus Ernst

    #2
    Re: Undefined Index notices

    Craig Morrison schrieb:[color=blue]
    > I'm getting this:
    >
    > [client 192.168.5.50] PHP Notice: Undefined index: D1 in
    > /var/www/html.....
    >
    > From this line of code:
    >
    > $id_option = $_POST['D1'];
    >
    > Which is posted by this:
    >
    > <form target="_blank" method="POST" action="mailcha rt.php"
    > name="mail_data ">
    > <input type="hidden" name="D1" value="<? echo $id_option; ?>">
    > <input type="submit" value="View Chart"></p>
    > </form>
    >
    > My question is why?
    >
    > I *am* getting the correct value for $_POST['D1'] and at this point in
    > time am really quite confused because that notice is getting thrown.[/color]

    Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )? In
    such cases I usually try this first; if $_POST['D1'] is set at the top
    of the script you might find out where it gets lost.

    --
    Markus

    Comment

    • Craig Morrison

      #3
      Re: Undefined Index notices

      Markus Ernst wrote:[color=blue]
      > Craig Morrison schrieb:[color=green]
      >> I'm getting this:
      >>
      >> [client 192.168.5.50] PHP Notice: Undefined index: D1 in
      >> /var/www/html.....
      >>
      >> From this line of code:
      >>
      >> $id_option = $_POST['D1'];
      >>
      >> Which is posted by this:
      >>
      >> <form target="_blank" method="POST" action="mailcha rt.php"
      >> name="mail_data ">
      >> <input type="hidden" name="D1" value="<? echo $id_option; ?>">
      >> <input type="submit" value="View Chart"></p>
      >> </form>
      >>
      >> My question is why?
      >>
      >> I *am* getting the correct value for $_POST['D1'] and at this point in
      >> time am really quite confused because that notice is getting thrown.[/color]
      >
      > Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )? In
      > such cases I usually try this first; if $_POST['D1'] is set at the top
      > of the script you might find out where it gets lost.
      >[/color]

      The question is, if it's invalid how come I am getting the correct value
      that is POSTed to the script?

      Craig

      Comment

      • Bent Stigsen

        #4
        Re: Undefined Index notices

        Craig Morrison wrote:
        [color=blue]
        > Markus Ernst wrote:[color=green]
        >> Craig Morrison schrieb:[color=darkred]
        >>> I'm getting this:[/color][/color][/color]
        [snip][color=blue][color=green][color=darkred]
        >>> My question is why?
        >>>
        >>> I *am* getting the correct value for $_POST['D1'] and at this point in
        >>> time am really quite confused because that notice is getting thrown.[/color]
        >>
        >> Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )? In
        >> such cases I usually try this first; if $_POST['D1'] is set at the top
        >> of the script you might find out where it gets lost.[/color]
        >
        > The question is, if it's invalid how come I am getting the correct value
        > that is POSTed to the script?[/color]

        That's a pretty moot question, unless you think magic is causing it.

        Consider it a flaw/bug in your construction. Markus' suggestion might get
        you some insight into what might be the problem.

        /Bent

        Comment

        • Craig Morrison

          #5
          Re: Undefined Index notices

          Bent Stigsen wrote:[color=blue]
          > Craig Morrison wrote:
          >[color=green]
          >> Markus Ernst wrote:[color=darkred]
          >>> Craig Morrison schrieb:
          >>>> I'm getting this:[/color][/color]
          > [snip][color=green][color=darkred]
          >>>> My question is why?
          >>>>
          >>>> I *am* getting the correct value for $_POST['D1'] and at this point in
          >>>> time am really quite confused because that notice is getting thrown.
          >>> Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )? In
          >>> such cases I usually try this first; if $_POST['D1'] is set at the top
          >>> of the script you might find out where it gets lost.[/color]
          >> The question is, if it's invalid how come I am getting the correct value
          >> that is POSTed to the script?[/color]
          >
          > That's a pretty moot question, unless you think magic is causing it.
          >
          > Consider it a flaw/bug in your construction. Markus' suggestion might get
          > you some insight into what might be the problem.
          >
          > /Bent[/color]

          How is it moot?

          A form posts the value for D1 to a script, script looks for the value of
          D1 and gets it. PHP raises a notice that D1 is undefined.

          I don't understand how I am getting the value that is posted to the
          script if the index is undefined.

          Is it really that difficult for someone to explain this?

          Craig

          Comment

          • Craig Morrison

            #6
            Re: Undefined Index notices

            Bent Stigsen wrote:[color=blue]
            > Craig Morrison wrote:
            >[color=green]
            >> Markus Ernst wrote:[color=darkred]
            >>> Craig Morrison schrieb:
            >>>> I'm getting this:[/color][/color]
            > [snip][color=green][color=darkred]
            >>>> My question is why?
            >>>>
            >>>> I *am* getting the correct value for $_POST['D1'] and at this point in
            >>>> time am really quite confused because that notice is getting thrown.
            >>> Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )? In
            >>> such cases I usually try this first; if $_POST['D1'] is set at the top
            >>> of the script you might find out where it gets lost.[/color]
            >> The question is, if it's invalid how come I am getting the correct value
            >> that is POSTed to the script?[/color]
            >
            > That's a pretty moot question, unless you think magic is causing it.
            >
            > Consider it a flaw/bug in your construction. Markus' suggestion might get
            > you some insight into what might be the problem.
            >
            > /Bent[/color]

            As a follow up, print_r($_POST) yields:

            Array
            (
            [D1] => 3
            )

            And I still get the notice..

            Craig

            Comment

            • Bent Stigsen

              #7
              Re: Undefined Index notices

              Craig Morrison wrote:
              [color=blue]
              > Bent Stigsen wrote:[color=green]
              >> Craig Morrison wrote:
              >>[color=darkred]
              >>> Markus Ernst wrote:
              >>>> Craig Morrison schrieb:
              >>>>> I'm getting this:[/color]
              >> [snip][color=darkred]
              >>>>> My question is why?
              >>>>>
              >>>>> I *am* getting the correct value for $_POST['D1'] and at this point in
              >>>>> time am really quite confused because that notice is getting thrown.
              >>>> Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )?
              >>>> In such cases I usually try this first; if $_POST['D1'] is set at the
              >>>> top of the script you might find out where it gets lost.
              >>> The question is, if it's invalid how come I am getting the correct value
              >>> that is POSTed to the script?[/color]
              >>
              >> That's a pretty moot question, unless you think magic is causing it.
              >>
              >> Consider it a flaw/bug in your construction. Markus' suggestion might get
              >> you some insight into what might be the problem.
              >>
              >> /Bent[/color]
              >
              > How is it moot?[/color]

              Well, I can't see how PHP would get the value, if the index was invalid or
              non-existing.
              [color=blue]
              > A form posts the value for D1 to a script, script looks for the value of
              > D1 and gets it. PHP raises a notice that D1 is undefined.
              >
              > I don't understand how I am getting the value that is posted to the
              > script if the index is undefined.
              >
              > Is it really that difficult for someone to explain this?[/color]

              Yes, because in all likelyhood, that is not what is happening.

              Arrays and forms are so commonly used that, if it was a bug then it would be
              reported all over the place.


              /Bent

              Comment

              • Craig Morrison

                #8
                Re: Undefined Index notices

                Bent Stigsen wrote:[color=blue]
                > Craig Morrison wrote:
                >[color=green]
                >> Bent Stigsen wrote:[color=darkred]
                >>> Craig Morrison wrote:
                >>>
                >>>> Markus Ernst wrote:
                >>>>> Craig Morrison schrieb:
                >>>>>> I'm getting this:
                >>> [snip]
                >>>>>> My question is why?
                >>>>>>
                >>>>>> I *am* getting the correct value for $_POST['D1'] and at this point in
                >>>>>> time am really quite confused because that notice is getting thrown.
                >>>>> Have you checked this, i.e. with print_r($_POST) or var_dump($_POST )?
                >>>>> In such cases I usually try this first; if $_POST['D1'] is set at the
                >>>>> top of the script you might find out where it gets lost.
                >>>> The question is, if it's invalid how come I am getting the correct value
                >>>> that is POSTed to the script?
                >>> That's a pretty moot question, unless you think magic is causing it.
                >>>
                >>> Consider it a flaw/bug in your construction. Markus' suggestion might get
                >>> you some insight into what might be the problem.
                >>>
                >>> /Bent[/color]
                >> How is it moot?[/color]
                >
                > Well, I can't see how PHP would get the value, if the index was invalid or
                > non-existing.
                >[color=green]
                >> A form posts the value for D1 to a script, script looks for the value of
                >> D1 and gets it. PHP raises a notice that D1 is undefined.
                >>
                >> I don't understand how I am getting the value that is posted to the
                >> script if the index is undefined.
                >>
                >> Is it really that difficult for someone to explain this?[/color]
                >
                > Yes, because in all likelyhood, that is not what is happening.
                >
                > Arrays and forms are so commonly used that, if it was a bug then it would be
                > reported all over the place.
                >
                >
                > /Bent[/color]

                I didn't say that it was a bug..

                I'd yell louder if I thought it was. :-)

                But I am getting the correct value, as you can see from the follow up
                that I posted which does a print_r..

                Craig

                Comment

                • Bent Stigsen

                  #9
                  Re: Undefined Index notices

                  Craig Morrison wrote:[color=blue]
                  > Bent Stigsen wrote:[color=green]
                  >> Craig Morrison wrote:[/color][/color]
                  [snip][color=blue][color=green][color=darkred]
                  >>> A form posts the value for D1 to a script, script looks for the value of
                  >>> D1 and gets it. PHP raises a notice that D1 is undefined.
                  >>>
                  >>> I don't understand how I am getting the value that is posted to the
                  >>> script if the index is undefined.
                  >>>
                  >>> Is it really that difficult for someone to explain this?[/color]
                  >>
                  >> Yes, because in all likelyhood, that is not what is happening.
                  >>
                  >> Arrays and forms are so commonly used that, if it was a bug then it would
                  >> be reported all over the place.
                  >>
                  >>
                  >> /Bent[/color]
                  >
                  > I didn't say that it was a bug..
                  >
                  > I'd yell louder if I thought it was. :-)[/color]

                  Sorry, if what you say is happening, really is happening, then it is a bug,
                  and since you didn't take Markus seriously, I assumed you did think it was.
                  [color=blue]
                  > But I am getting the correct value, as you can see from the follow up
                  > that I posted which does a print_r..[/color]

                  You must be doing something or making assumptions that you consider
                  unimportant to tell, because it doesn't make sense. Are you sure you are
                  not seeing the notice *before* submitting the form, or subsequently do a
                  redirect, or do some fiddling with the _POST-array elsewhere?


                  /Bent

                  Comment

                  • Craig Morrison

                    #10
                    Re: Undefined Index notices

                    Bent Stigsen wrote:[color=blue]
                    > Craig Morrison wrote:[color=green]
                    >> Bent Stigsen wrote:[color=darkred]
                    >>> Craig Morrison wrote:[/color][/color]
                    > [snip][color=green][color=darkred]
                    >>>> A form posts the value for D1 to a script, script looks for the value of
                    >>>> D1 and gets it. PHP raises a notice that D1 is undefined.
                    >>>>
                    >>>> I don't understand how I am getting the value that is posted to the
                    >>>> script if the index is undefined.
                    >>>>
                    >>>> Is it really that difficult for someone to explain this?
                    >>> Yes, because in all likelyhood, that is not what is happening.
                    >>>
                    >>> Arrays and forms are so commonly used that, if it was a bug then it would
                    >>> be reported all over the place.
                    >>>
                    >>>
                    >>> /Bent[/color]
                    >> I didn't say that it was a bug..
                    >>
                    >> I'd yell louder if I thought it was. :-)[/color]
                    >
                    > Sorry, if what you say is happening, really is happening, then it is a bug,
                    > and since you didn't take Markus seriously, I assumed you did think it was.[/color]

                    You shouldn't make assumptions, that is a fatal flaw. You assumed that I
                    didn't take his advice seriously. Don't jump to conclusions it makes you
                    look like a, well... That's another matter, read on..
                    [color=blue]
                    >[color=green]
                    >> But I am getting the correct value, as you can see from the follow up
                    >> that I posted which does a print_r..[/color]
                    >
                    > You must be doing something or making assumptions that you consider
                    > unimportant to tell, because it doesn't make sense. Are you sure you are
                    > not seeing the notice *before* submitting the form, or subsequently do a
                    > redirect, or do some fiddling with the _POST-array elsewhere?[/color]

                    I am not making any assumptions, just writing code according to the
                    documentation. I gave the HTML that posts its results already..

                    These are the first 3 lines of the script that gets posted to..

                    <?
                    include 'inc/config.inc.php' ;
                    ?>

                    The notice is generated in config.inc.php, which follows...

                    <?
                    // define query titles
                    $id_text[1]="Group Total Sent &amp; Received";
                    $id_text[2]="EU Total Sent &amp; Received";
                    $id_text[3]="EU Total Sent";
                    $id_text[4]="EU Total Received";
                    $id_text[5]="EU Sent By User";
                    $id_text[6]="EU Received By User";
                    $id_text[7]="US Total Sent &amp; Received";
                    $id_text[8]="US Total Sent";
                    $id_text[9]="US Total Received";
                    $id_text[10]="US Sent By User";
                    $id_text[11]="US Received By User";
                    $id_text[12]="All Domains";

                    // define view names
                    $id_view[1]="GroupTotal ";
                    $id_view[2]="EUTotal";
                    $id_view[3]="EUAllSent" ;
                    $id_view[4]="EUAllRcvd" ;
                    $id_view[5]="EUSent";
                    $id_view[6]="EURcvd";
                    $id_view[7]="USTotal";
                    $id_view[8]="USAllSent" ;
                    $id_view[9]="USAllRcvd" ;
                    $id_view[10]="USSent";
                    $id_view[11]="USRcvd";
                    $id_view[12]="AllDomainsTot al";

                    // define column styles
                    $fc_col_styles['TOTAL'] = 'no';
                    $fc_col_styles['Total'] = 'no';
                    $fc_col_styles['SENT'] = 'no';
                    $fc_col_styles['Sent'] = 'no';
                    $fc_col_styles['RCVD'] = 'no';
                    $fc_col_styles['Rcvd'] = 'no';
                    $fc_col_styles['Month'] = 'mo';
                    $fc_col_styles['MONTH'] = 'mo';
                    $fc_col_styles['User'] = 'us';
                    $fc_col_styles['USER'] = 'us';
                    $fc_col_styles['MBytes'] = 'mb';
                    $fc_col_styles['MBYTES'] = 'mb';

                    // set default values
                    $id_text_count = 12;
                    $id_option = 1;

                    // determine what view we are querying
                    if ($_SERVER['REQUEST_METHOD '] == 'POST')
                    $id_option = $_POST['D1']; // <=== DING we have winner, notice gets raised
                    else if ($_SERVER['REQUEST_METHOD '] == 'GET')
                    $id_option = $_GET['D1'];

                    if (($id_option == 0) || ($id_option > $id_text_count) ) {$id_option = 1;}
                    $selectID = $id_view[$id_option];
                    ?>

                    As you can see, there is nothing but good php there.

                    Now, here's where I get pissed off. You all assumed that I was just
                    pissing in the wind. I gave a good explanation of what I was doing
                    before and this code tells you nothing more.

                    Next time, ask for answers before being an ass and assuming you are
                    working with a n00b..

                    Craig

                    Comment

                    • Bent Stigsen

                      #11
                      Re: Undefined Index notices

                      Craig Morrison wrote:
                      [color=blue]
                      > Bent Stigsen wrote:[color=green]
                      >> Craig Morrison wrote:[color=darkred]
                      >>> Bent Stigsen wrote:
                      >>>> Craig Morrison wrote:[/color]
                      >> [snip][color=darkred]
                      >>>>> A form posts the value for D1 to a script, script looks for the value
                      >>>>> of D1 and gets it. PHP raises a notice that D1 is undefined.
                      >>>>>
                      >>>>> I don't understand how I am getting the value that is posted to the
                      >>>>> script if the index is undefined.
                      >>>>>
                      >>>>> Is it really that difficult for someone to explain this?
                      >>>> Yes, because in all likelyhood, that is not what is happening.
                      >>>>
                      >>>> Arrays and forms are so commonly used that, if it was a bug then it
                      >>>> would be reported all over the place.
                      >>>>
                      >>>>
                      >>>> /Bent
                      >>> I didn't say that it was a bug..
                      >>>
                      >>> I'd yell louder if I thought it was. :-)[/color]
                      >>
                      >> Sorry, if what you say is happening, really is happening, then it is a
                      >> bug, and since you didn't take Markus seriously, I assumed you did think
                      >> it was.[/color]
                      >
                      > You shouldn't make assumptions, that is a fatal flaw. You assumed that I
                      > didn't take his advice seriously. Don't jump to conclusions it makes you
                      > look like a, well... That's another matter, read on..[/color]

                      Yes yes, I know I can be an insensitive prick. Honestly, I try to better
                      myself. Perhaps I grow up someday.
                      [color=blue][color=green][color=darkred]
                      >>> But I am getting the correct value, as you can see from the follow up
                      >>> that I posted which does a print_r..[/color]
                      >>
                      >> You must be doing something or making assumptions that you consider
                      >> unimportant to tell, because it doesn't make sense. Are you sure you are
                      >> not seeing the notice *before* submitting the form, or subsequently do a
                      >> redirect, or do some fiddling with the _POST-array elsewhere?[/color]
                      >
                      > I am not making any assumptions, just writing code according to the
                      > documentation. I gave the HTML that posts its results already..
                      >
                      > These are the first 3 lines of the script that gets posted to..
                      >
                      > <?
                      > include 'inc/config.inc.php' ;
                      > ?>
                      >
                      > The notice is generated in config.inc.php, which follows...[/color]
                      [snip][color=blue]
                      > // determine what view we are querying
                      > if ($_SERVER['REQUEST_METHOD '] == 'POST')
                      > $id_option = $_POST['D1']; // <=== DING we have winner, notice gets raised
                      > else if ($_SERVER['REQUEST_METHOD '] == 'GET')
                      > $id_option = $_GET['D1'];
                      >
                      > if (($id_option == 0) || ($id_option > $id_text_count) ) {$id_option = 1;}
                      > $selectID = $id_view[$id_option];
                      > ?>
                      >
                      > As you can see, there is nothing but good php there.[/color]

                      Yes, it looks fine.
                      [color=blue]
                      > Now, here's where I get pissed off. You all assumed that I was just
                      > pissing in the wind. I gave a good explanation of what I was doing
                      > before and this code tells you nothing more.
                      >
                      > Next time, ask for answers before being an ass and assuming you are
                      > working with a n00b..[/color]

                      Sorry I couldn't be more sensitive in my wording, but I think you are being
                      a bit touchy. For the record, I didn't think you were a n00b, just one of
                      those guys with an infinite faith in their own infallibility, who
                      apparently get all huffy at the mere suggestion that they made an error.

                      If you find it to be some funky bug in PHP, then I will unreservedly
                      apologize for anything you find fit. Alternatively when you find it to be
                      some banal mistake in your code, I hope you'll find it in you to forgive my
                      bruteness.


                      /Bent

                      Comment

                      • Craig Morrison

                        #12
                        Re: Undefined Index notices

                        Bent Stigsen wrote:[color=blue]
                        > Craig Morrison wrote:
                        >[color=green]
                        >> Bent Stigsen wrote:[color=darkred]
                        >>> Craig Morrison wrote:
                        >>>> Bent Stigsen wrote:
                        >>>>> Craig Morrison wrote:
                        >>> [snip]
                        >>>>>> A form posts the value for D1 to a script, script looks for the value
                        >>>>>> of D1 and gets it. PHP raises a notice that D1 is undefined.
                        >>>>>>
                        >>>>>> I don't understand how I am getting the value that is posted to the
                        >>>>>> script if the index is undefined.
                        >>>>>>
                        >>>>>> Is it really that difficult for someone to explain this?
                        >>>>> Yes, because in all likelyhood, that is not what is happening.
                        >>>>>
                        >>>>> Arrays and forms are so commonly used that, if it was a bug then it
                        >>>>> would be reported all over the place.
                        >>>>>
                        >>>>>
                        >>>>> /Bent
                        >>>> I didn't say that it was a bug..
                        >>>>
                        >>>> I'd yell louder if I thought it was. :-)
                        >>> Sorry, if what you say is happening, really is happening, then it is a
                        >>> bug, and since you didn't take Markus seriously, I assumed you did think
                        >>> it was.[/color]
                        >> You shouldn't make assumptions, that is a fatal flaw. You assumed that I
                        >> didn't take his advice seriously. Don't jump to conclusions it makes you
                        >> look like a, well... That's another matter, read on..[/color]
                        >
                        > Yes yes, I know I can be an insensitive prick. Honestly, I try to better
                        > myself. Perhaps I grow up someday.
                        >[color=green][color=darkred]
                        >>>> But I am getting the correct value, as you can see from the follow up
                        >>>> that I posted which does a print_r..
                        >>> You must be doing something or making assumptions that you consider
                        >>> unimportant to tell, because it doesn't make sense. Are you sure you are
                        >>> not seeing the notice *before* submitting the form, or subsequently do a
                        >>> redirect, or do some fiddling with the _POST-array elsewhere?[/color]
                        >> I am not making any assumptions, just writing code according to the
                        >> documentation. I gave the HTML that posts its results already..
                        >>
                        >> These are the first 3 lines of the script that gets posted to..
                        >>
                        >> <?
                        >> include 'inc/config.inc.php' ;
                        >> ?>
                        >>
                        >> The notice is generated in config.inc.php, which follows...[/color]
                        > [snip][color=green]
                        >> // determine what view we are querying
                        >> if ($_SERVER['REQUEST_METHOD '] == 'POST')
                        >> $id_option = $_POST['D1']; // <=== DING we have winner, notice gets raised
                        >> else if ($_SERVER['REQUEST_METHOD '] == 'GET')
                        >> $id_option = $_GET['D1'];
                        >>
                        >> if (($id_option == 0) || ($id_option > $id_text_count) ) {$id_option = 1;}
                        >> $selectID = $id_view[$id_option];
                        >> ?>
                        >>
                        >> As you can see, there is nothing but good php there.[/color]
                        >
                        > Yes, it looks fine.
                        >[color=green]
                        >> Now, here's where I get pissed off. You all assumed that I was just
                        >> pissing in the wind. I gave a good explanation of what I was doing
                        >> before and this code tells you nothing more.
                        >>
                        >> Next time, ask for answers before being an ass and assuming you are
                        >> working with a n00b..[/color]
                        >
                        > Sorry I couldn't be more sensitive in my wording, but I think you are being
                        > a bit touchy. For the record, I didn't think you were a n00b, just one of
                        > those guys with an infinite faith in their own infallibility, who
                        > apparently get all huffy at the mere suggestion that they made an error.[/color]

                        Touchy? I don't think so.

                        Is there any error in the code? If there is, by all means point it out.
                        That *is* the point behind posting it.

                        You seem to be on the track that I am trying to find fault here, which
                        is an error. I am not. So get over that.

                        I am simply trying to understand the behavior.
                        [color=blue]
                        >
                        > If you find it to be some funky bug in PHP, then I will unreservedly
                        > apologize for anything you find fit. Alternatively when you find it to be
                        > some banal mistake in your code, I hope you'll find it in you to forgive my
                        > bruteness.[/color]

                        I still don't have an answer to the original query though.

                        As it stands, the app works and I may very well be being quite pedantic
                        about the whole mess but I would like some insight as to why the notice
                        is thrown. Which was the whole point behind this thread.

                        I showed the code that was throwing the notice and you (or anyone else)
                        have shed no light on the problem. I don't know what else I can do or
                        show to make it any clearer what is happening.

                        Maybe we both need to steer clear of the fan.

                        Craig

                        Comment

                        • Bent Stigsen

                          #13
                          Re: Undefined Index notices

                          Craig Morrison wrote:
                          [snip][color=blue]
                          > Touchy? I don't think so.
                          >
                          > Is there any error in the code? If there is, by all means point it out.
                          > That *is* the point behind posting it.[/color]

                          I allready did point out what I thought, but you'll probably just call me an
                          ass again, if I repeat it.

                          [color=blue]
                          > You seem to be on the track that I am trying to find fault here, which
                          > is an error. I am not. So get over that.
                          >
                          > I am simply trying to understand the behavior.[/color]

                          I don't understand why you think there is a "behavior". There is nothing
                          exotic in what you are trying to do. Too common a task, for there to be an
                          oddity that everybody else is missing.

                          [color=blue][color=green]
                          >> If you find it to be some funky bug in PHP, then I will unreservedly
                          >> apologize for anything you find fit. Alternatively when you find it to be
                          >> some banal mistake in your code, I hope you'll find it in you to forgive
                          >> my bruteness.[/color]
                          >
                          > I still don't have an answer to the original query though.
                          >
                          > As it stands, the app works and I may very well be being quite pedantic
                          > about the whole mess but I would like some insight as to why the notice
                          > is thrown. Which was the whole point behind this thread.
                          >
                          > I showed the code that was throwing the notice and you (or anyone else)
                          > have shed no light on the problem. I don't know what else I can do or
                          > show to make it any clearer what is happening.[/color]

                          You present your conclusions of what is happening and pieces of code you say
                          is involved. No offense meant, but I can't take that as certainty. I really
                          don't know any other way of putting it than, you must have overlooked
                          something, doing something or making assumptions that you consider
                          unimportant. If this pisses you off, then by all means call me a moron, and
                          I shall not bother you again.


                          /Bent

                          Comment

                          • Geoff Berrow

                            #14
                            Re: Undefined Index notices

                            Message-ID: <wL6dnTTZZNkadB TZnZ2dnUVZ_v6dn Z2d@insightbb.c om> from Craig
                            Morrison contained the following:
                            [color=blue]
                            > if ($_SERVER['REQUEST_METHOD '] == 'POST')
                            > $id_option = $_POST['D1']; // <=== DING we have winner, notice gets raised[/color]

                            Dumb question. You get the notice /after/ the form is posted?

                            Have you tried
                            $id_option =(isset($_POST['D1'])? $_POST['D1'] : "";




                            --
                            Geoff Berrow (put thecat out to email)
                            It's only Usenet, no one dies.
                            My opinions, not the committee's, mine.
                            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                            Comment

                            • Geoff Berrow

                              #15
                              Re: Undefined Index notices

                              Message-ID: <iofl82t61jt0re 6ulot20ul1n81l0 u5guq@4ax.com> from Geoff
                              Berrow contained the following:
                              [color=blue]
                              >Have you tried
                              >$id_option =(isset($_POST['D1'])? $_POST['D1'] : "";[/color]

                              sorry..
                              $id_option =(isset($_POST['D1'])? $_POST['D1'] : 1;

                              --
                              Geoff Berrow (put thecat out to email)
                              It's only Usenet, no one dies.
                              My opinions, not the committee's, mine.
                              Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                              Comment

                              Working...