Re: Re: Variable name as a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



More specifically:

<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<p>option 1 - colour:<br/>
# <input type="checkbox" name="options[colour][]" value="red"/> red<br/>
# <input type="checkbox" name="options[colour][]" value="green"/>
green<br/>
# <input type="checkbox" name="options[colour][]" value="blue"/>
blue</p>
<p><input type="submit"/></p>
</form>

<?php
	foreach($_POST['options']['colour'] as $colour)
		echo "<p>colour: $colour</p>\n";
?>
-- 
Ross McKay, Toronto, NSW Australia
"If ye cannae see the bottom, dinnae complain if ye droon"
- The Wee Book of Calvin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux