Submit Button Question

Discussion in 'PHP' started by dwest, Jan 18, 2007.

  1. #1
    With submit buttons, using php on the form processing page, can I capture the button value or am I limited to the name only?

    If I can capture the value, what's the syntax??

    Thanks much!
     
    dwest, Jan 18, 2007 IP
  2. West

    West Peon

    Messages:
    79
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The name is what is caught by $_POST. Nothing more.
     
    West, Jan 18, 2007 IP
  3. dwest

    dwest Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks much.
     
    dwest, Jan 18, 2007 IP
  4. goscript

    goscript Prominent Member

    Messages:
    2,753
    Likes Received:
    306
    Best Answers:
    0
    Trophy Points:
    315
    #4
    your page
    <input type=button name="button1" value="value1">

    php page

    $_POST["button1"] will return value1
    if you use GET to submit form then use
    $_GET["button1"]
     
    goscript, Jan 18, 2007 IP