note 21048 added to reserved.variables
| From: | hfuecks at pinkgoblin dot com | Date: | Fri, 26 Apr 2002 15:56:21 +0000 |
| Subject: | note 21048 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29880@lists.php.net to get a copy of this message | ||
If you're using things like <select multiple> in an HTML form, you can extract the data
from the $_GET / $_POST / $_COOKIE / $_SESSION variables by addressing it as a multi dimensional
array.
For example;
<?php
if ( ISSET ( $_GET[submit] ) ) {
echo ( $_GET[variable][0] );
}
?>
<form action=<?php echo ( $_SERVER[PHP_SELF] ); ?> method="get">
<select name="variable[]" multiple>
<option>A
<option>B
<option>C
<option>D
</select>
<input type="submit" name="submit">
</form>
There's more on multi dimensional arrays here: http://www.phpbuilder.com/getit/arrays.php3
--
http://www.php.net/manual/en/reserved.variables.php
http://master.php.net/manage/user-notes.php?action=edit+21048
http://master.php.net/manage/user-notes.php?action=delete+21048
http://master.php.net/manage/user-notes.php?action=reject+21048