Results 1 to 3 of 3

Thread: php html post

  1. #1
    Join Date
    Oct 2011

    php html post

    if I have the following html in which there is a series of submit buttons and a corresponding text field, which differ only in their names via a counter...

    <form name="form_test" method="post" action="PHP_TEST.php">
    <input type="text" name="input_1"></input>
    <input type="submit" name="submit_1"></input>
    <input type="text" name="input_2"></input>
    <input type="submit" name="submit_2"></input>
    <input type="text" name="input_3"></input>
    <input type="submit" name="submit_3"></input>

    I want a php file to be called whenever a sumbit is pressed. My question is how in PHP can I get the value of the corresponding text input whenever its submit button is pressed.

  2. #2
    Join Date
    Feb 2012
    PHP Code:
    // $_POST['input_1']
    // $_POST['input_2']
    // $_POST['input_3']

  3. #3
    Join Date
    Oct 2011
    Yeah i considered that, but there may be a LOT of these if statements that way. Is there any more simple/elegant way of doing this?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center