Re: 2values on form, help in catching as one.
| From: | Jason Sheets | Date: | Wed, 02 Jul 2003 05:10:55 +0000 |
| Subject: | Re: 2values on form, help in catching as one. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153664@lists.php.net to get a copy of this message | ||
You could do it a couple different ways, if you just want to combine the values the easiest way is:
$v_template = $_REQUEST['TemplateOne'] . $_REQUEST['TemplateTwo'];
If you want a space between the two values expand on this idea using:
$v_template = $_REQUEST['TemplateOne'] . ' ' . $_REQUEST['TemplateTwo'];
If you get a minute checkout the PHP manual at http://www.php.net/manual, it covers this topic and has quite a few useful tips in it.
Jason
Miranda, Joel Louie M wrote:
I have this php code (below), My form passes 2 values w/c is TemplateOne and TemplateTwo I was wondering how could I make that in php to catch the value as one only? I tried this and it didn't work. But if the value is just one the case display it. Any ideas? <?php $v_template = $_REQUEST['TemplateOne'] ; $v_template = $_REQUEST['TemplateTwo'] ; switch($v_template) { case 'TemplateOne': echo "one"; break; case 'TemplateTwo': echo "two"; break; } ?> -- Thank you, Miranda, Louie