Re: yes and no buttons and posting

From: Date: Thu, 09 May 2002 02:06:24 +0000
Subject: Re: yes and no buttons and posting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-96736@lists.php.net to get a copy of this message
Baldey_uk wrote:
Hi all again, This is probably another simple question to answer: I want to have a page where someone answers a question with a yes or no button, which are provided by HTML (im not sure whether it is possible to do this with PHP?). How with php can i say ' if they hit the HTML yes button, go to this page else if they hit the HTML no button go to this page'? Thanks again for any help! Cheers From baldey_uk
Quite easily... have two buttons, <input type=submit name=choice value=yes><input type=submit name=choice value=no> and in your script have: switch($_GET['choice']) // or $_POST['choice'] accordingly { case "yes" : do this; break; case "no" : do something else; break; }

« previous php.general (#96736) next »