Created
December 29, 2013 08:34
-
-
Save michaeluno/8168606 to your computer and use it in GitHub Desktop.
A PHP form demo to show the data structure of the submitted select fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( isset( $_POST['save'] ) ) | |
die( '<pre>' . print_r( $_POST, true ) . '</pre>' ); | |
?> | |
<html> | |
<body> | |
<form accept-charset="UTF-8" action="" method="post"> | |
<select name="single_select" size="1" > | |
<option value="apple">Apple</option> | |
<option value="banana">Banana</option> | |
<option value="cherry">Cherry</option> | |
</select> | |
<br /> | |
<select name="multiple_selects[]" multiple="multiple"> | |
<option value="one">One</option> | |
<option value="two">Twp</option> | |
<option value="three">Three</option> | |
</select> | |
<input class="button primary" name="save" type="submit" value="Save" /> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment