passing value of index number to different php file.

Posted by tooepic on Stack Overflow See other posts from Stack Overflow or by tooepic
Published on 2010-04-10T18:29:32Z Indexed on 2010/04/10 18:33 UTC
Read the original article Hit count: 444

Filed under:

hi, i am a php beginner and have a question for you please.

i have a text file with list of first and last names like this:

john,smith
sam,lewis
david,davidson
mike,anderson

in my sort.php file, it sorts that name list by first name in ascending order with index number, which will display like this:

1. david,davidson
2. john,smith
3. mike,anderson
4. sam,lewis

also, in that sort.php file, there's a form for input type=text where you can type index number and a button to delete that index number entered in that text field:

<form action="deletename.php" method="post">
  <table>
    <tr valign="top"> 
      <td>Delete: <input type="text" size="2" name="indexnumber" />
      </td>
      <td> 
        <div align="left"> 
          <input type="submit" name="delete" value="Delete" />
        </div>
      </td>
    </tr>
  </table>
</form>

now the question...is there anything i can do in that form to send the value of that index number i entered in the text field? in other word...if i enter 3, what can i do to that form to send the value "mike,anderson" to deletename.php?

thanks in advance.

© Stack Overflow or respective owner

Related posts about php