validateing form arrays

Discussion in 'PHP' started by mnymkr, Sep 9, 2007.

  1. #1
    i am having some trouble here

    i have a form that produces an array in a $_GET url

    color[]=yadda&color[]=jikes

    neither isset nor emply seems to correctly check for the variable

    if i enter a blank into the url

    color[]=

    then it returns TRUE everytime
     
    mnymkr, Sep 9, 2007 IP
  2. abixalmon

    abixalmon Well-Known Member

    Messages:
    378
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #2
    you may try direct way

    
    if ($color=='') { bla bla } 
    
    if ($color[0]=='' || $color[1]=='') { bla bla } 
    
    Code (markup):
     
    abixalmon, Sep 9, 2007 IP
  3. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #3
    thanks ill give it a go
     
    mnymkr, Sep 10, 2007 IP