GET variable for text type always in url?

Discussion in 'PHP' started by mnymkr, Jun 21, 2007.

  1. #1
    I am just curious here.

    For radio and check boxes, if you do not enter a value their corresponding varialbe does not appear in the $_GET url

    however with text boxes, it will appear at variable= why is this, if there is not value why not , not have it appear?
     
    mnymkr, Jun 21, 2007 IP
  2. mrmonster

    mrmonster Active Member

    Messages:
    374
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #2
    A radio\checkbox are activated when they are checked, nothing to pass before that, those elements are assigned value when they are activated.

    A textbox always has a value, even if you don't type anything yourself.

    Hehe, I hope that makes some sense:)
     
    mrmonster, Jun 21, 2007 IP
  3. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #3
    yeah that makes sense and i should have thought about so, no matter what a txt box varialbe will apear in the url even if it has no value?
     
    mnymkr, Jun 21, 2007 IP
  4. mrmonster

    mrmonster Active Member

    Messages:
    374
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Textbox always has a value, with "" being the default unless you enter something else.
     
    mrmonster, Jun 21, 2007 IP
  5. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Yes, think of a textbox as a string (a string can have 0 length), and checkboxes/radio buttons almost like booleans, returning the value or just null.
     
    krt, Jun 21, 2007 IP