Re: $_POST variable

From: Date: Sat, 12 Mar 2011 16:37:09 +0000
Subject: Re: $_POST variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-311818@lists.php.net to get a copy of this message
At 9:28 PM +0200 3/11/11, Danny wrote:
Hi guys, I have a form that has a long list of radio-bottons inside of it. The radio-buttons are dynamically created via php and MySQL. Here is an example of one of the radio buttons: <input type="radio" name="<?php print ("radio_".$result_from_mysql) ; ?>" value="0"> <input type="radio" name="<?php print ("radio_".$result_from_mysql) ; ?>" value="1"> Now, when I submit this form to another page for processing, how would I "catch" the above radio-button's $_POST name since I do not know the name, only that it starts with "radio_" ? Thank You Danny
Danny: Replace <?php print ("radio_".$result_from_mysql) ; ?> with an option[] array. Realize that the name of the radio input stays the same -- it is the value that changes. Here's a demo: http://php1.net/b/form-radio1/ Don't make it more complicated than it needs be. Cheers, tedd -- ------- http://sperling.com/

« previous php.general (#311818) next »