Re: easier than switch

From: Date: Mon, 04 Aug 2003 22:54:10 +0000
Subject: Re: easier than switch
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-158203@lists.php.net to get a copy of this message
--- skate <root@fatcuban.com> wrote: > i have several forms on one page, they all submit a different variable The best solution would be to change this behavior, or at least add a consistent form variable that you plan to receive. > <? > if(isset($_POST)) > { > $type = $_POST['news'] || $_POST['dreams'] || > $_POST['storys'] || > $_POST['words'] || $_POST['chat']; > } > ?> > > obviously this doesn't work. but i wanna set $type depending on which > $_POST variable was sent. What you need to do is name your variable 'type', so that $_POST['type'] is either 'news', 'dreams', 'stories', 'words', or 'chat'. Hope that helps. Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/

« previous php.general (#158203) next »