We often have to make a number of choices for the user to process, such as allowing users to select multiple items of list items after the deletion of the selected items. Here's an example of how PHP and JavaScript deal with multiple choices, respectively. What we do today is a voting system that polls the MySQL database itemtable, and can only vote two votes per individual IP.
The table itemtable is established through the following MySQL statement:
CREATE TABLE ' itemtable ' (
' ID ' TINYINT (4) Not NULL auto_increment,
' Name ' VARCHAR not NULL,
' Votes ' SMALLINT (6) Not NULL,
PRIMARY KEY (' id ')
);
Where the field "name" is the list item name, "votes" is the resulting number of votes. We also want to create a table "voteiptable" to record the IP of the voting user:
CREATE TABLE ' voteiptable ' (
' ID ' SMALLINT (6) Not NULL,
' Voteip ' VARCHAR not NULL,
PRIMARY KEY (' id ')
);
Below we write the file "multivote.php", today we want to use a database class file "dbclass.php".
We can see that the client's JavaScript and server-side PHP have a lot in common with the processing of multiple choices, and of course they are different. This is a more classic multi-option processing program, if you do not qualify the user's choice of words is simpler.