POST and GET difference

Discussion in 'PHP' started by aaron_nimocks, Oct 14, 2006.

  1. #1
    Hope I can explain this.

    On my form I am using this line to pass info

    <input type='hidden' name='id' value='$id'>
    PHP:
    When I have the form setup as a method='POST' it doesnt pass the value.

    But when I have the form setup as a method='GET' it passes the info in the URL and I can grab it.

    So my question is can you pass a hidden form values using the POST function or do I have to use the GET?
     
    aaron_nimocks, Oct 14, 2006 IP
  2. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #2
    I think you mean this...

    $_GET usually shows things like, script.php?name=text, and you want to use $_GET like script.php which is what $_POST would do.

    I don't think you can, but then I'm a PHP noob.
     
    crazyryan, Oct 14, 2006 IP
  3. vatsia

    vatsia Guest

    Messages:
    182
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    make sure you use $_POST[id] on the target page :)
     
    vatsia, Oct 14, 2006 IP
  4. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #4
    I figured it out.

    Stupid mistake as usual. :)
     
    aaron_nimocks, Oct 14, 2006 IP
  5. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #5
    That is kind of where I messed up.

    I had _GET because I was testing something out and never went back and changed it. :)
     
    aaron_nimocks, Oct 14, 2006 IP