Re: radio form submission
| From: | Daniel P. Brown | Date: | Thu, 23 Jun 2011 18:47:46 +0000 |
| Subject: | Re: radio form submission | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47878@lists.php.net to get a copy of this message | ||
On Thu, Jun 23, 2011 at 14:18, Chris Stinemetz <chrisstinemetz@gmail.com> wrote:
> So far I am good on creating the form and submitting it to mysql
> database and calling the submitting value from a different script.
>
> My question is: How can I make it so when a user selects radio option
> value "1" it will then be displayed as 0-250kbps when I call it the
> value in the bottom script?
Use an if or a switch. For example:
<?php
// Using if/elseif/else
if ($row['tp_test'] == '1') {
echo '0-250Kbps';
} elseif ($row['tp_test'] == '2') {
echo 'The second value.';
} elseif ($row['tp_test'] == '3') {
echo 'The third value.';
} else {
echo 'I have no clue. I give up.';
}
// Using switch
switch ($row['tp_test']) {
case '1':
echo 'First case.';
break;
case '2':
echo 'Second case.';
break;
case '3':
echo 'Third case.';
break;
default:
echo 'No idea whatsoever.';
break;
}
?>
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/