Array not recognized when form submitted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • testuser
    New Member
    • Dec 2006
    • 6

    Array not recognized when form submitted

    works fine in FF, not in IE

    form
    Code:
    <form action = go.php method = get> <input type='checkbox' name='id[]' value='1'> <input type='checkbox' name='id[]' value='2'> <input type='checkbox' name='id[]' value='3'> <input type=submit value='Send'> </form>
    go.php
    Code:
    if (is_array($_GET["siteid"]))
    { 
    echo "IS ARRAY";
    }
    any ideas why?

    are there other ways in php to recognize the array?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by testuser
    works fine in FF, not in IE

    form
    Code:
    <form action = go.php method = get> <input type='checkbox' name='id[]' value='1'> <input type='checkbox' name='id[]' value='2'> <input type='checkbox' name='id[]' value='3'> <input type=submit value='Send'> </form>
    go.php
    Code:
    if (is_array($_GET["siteid"]))
    { 
    echo "IS ARRAY";
    }
    any ideas why?

    are there other ways in php to recognize the array?
    May because you use 'siteid' as the to be inspected array, while your select names are 'id[]'.

    Ronald :cool:

    Comment

    • testuser
      New Member
      • Dec 2006
      • 6

      #3
      whoops, i duplicated taht code freehand

      they are both labeled siteid

      Originally posted by ronverdonk
      May because you use 'siteid' as the to be inspected array, while your select names are 'id[]'.

      Ronald :cool:

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Well, I tested it in IE 6 and it worked! Must be something else.

        Ronald :cool:

        Comment

        • testuser
          New Member
          • Dec 2006
          • 6

          #5
          it was something else

          im an idiot haha

          tahnks for the help

          Originally posted by ronverdonk
          Well, I tested it in IE 6 and it worked! Must be something else.

          Ronald :cool:

          Comment

          Working...