Re: $_POST variable

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

 



On Fri, Mar 11, 2011 at 14:28, Danny <dannydebont@xxxxxxxxx> wrote:
[snip!]
>
> 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_" ?

    One method is a foreach() loop.

    <?php
        foreach ($_POST as $k => $v) {
            if (preg_match('/^radio_/Ui',trim($k))) {
                echo $k.' is a match, and it\'s value is '.$v.'.<br/>'.PHP_EOL;
            }
        }
    ?>

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

-- 
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