idea: the input box and button are generated with a for loop, not only to get the input box values, and to get the value of the click button, you know that the button is clicked, here to generate 5 for example.
This is the submission page, click on the "Xiaomi".
This is the result of the display, the test shows that the 3 is clicked on the third button, receive this value is convenient for the deletion and modification of the XML file, here omit the XML file operation.
Front desk input file: in.php
<!doctype html>displaying result files: out.php
<! DOCTYPE html>
JS file (used to assign values to the hidden field and pass the value to the processing file out.php, which is used primarily to determine which button was clicked) Mp3.js:
function Click0 () { document.getElementById ("hid"). value=0; } function Click1 () { document.getElementById ("hid"). value=1; } function Click2 () { document.getElementById ("hid"). value=2; } function Click3 () { document.getElementById ("hid"). value=3; } function Click4 () { document.getElementById ("hid"). value=4; }
How the form generated by the PHP loop obtains its various value cases