RE: [PHP] Dynamic Forms

From: Date: Mon, 15 Oct 2001 14:09:57 +0000
Subject: RE: [PHP] Dynamic Forms
Groups: php.general 
Request: Send a blank email to php-general+get-71105@lists.php.net to get a copy of this message
Hi, Something like this? (assumes a form field & variable called "orderType" which will either be "credit" or "debit" -- tweak for your setup) if (!isset($submit)) { // show form } else { // do validation // do generic stuff that happens for both credit & debit if ($orderType == "debit") { // mail debit card information } elseif ($orderType == "credit") { // mail credit card information } else { // do whatever happens for other types // you could leave this bit out if you caught it at // the validation stage earlier } // show thank you page } If that doesn't make any sense can you post the code for your form please? Cheers Jon -----Original Message----- From: Rudi Ahlers [mailto:kopspier@bigfoot.com] Sent: 15 October 2001 14:36 To: PHP General Subject: [PHP] Dynamic Forms Hi, me again I have a form, which can either display debit order details, or credit card details. When a user opens the page, he gets a dropdown menu, which gives him the options. If he selects debit order, the debit order form gets displayed, this is all done with if statements, no jscript. This works fine, but with the mail part I have a problem. How would I be able to tell my mail function what to mail, and what not to? When a user clicks on the debit option, it must only email the debit form's details, as the forms differ quite a bit. I tried doing it with a case statement, but with no luck. Can anyone please help me with this? Thanx Rudi Ahlers ********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' **********************************************************************

« previous php.general (#71105) next »