Re: submitting to differient php scripts based on button -O T-

From: Date: Tue, 03 Jun 2003 16:36:51 +0000
Subject: Re: submitting to differient php scripts based on button -O T-
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150000@lists.php.net to get a copy of this message
At 6/3/2003 04:24 PM, Ryan A wrote:
I simply want to submit my form to either one.php or two.php or thr.php depending on which BUTTON is pressed (I am using html buttons <input type='submit' value='blah'>) I have 3 buttons....how do i set it?
You can do this one of three ways: 1. Instead of actually submitting to a different php script, you submit to one script that gives a header location based on which submit button you use. So if I have three submit-type buttons, I'll just say IF($_POST['submit1']) { header("Location: script1.php"); } ELSEIF($_POST['submit2']) { header("Location: script2.php"); } etc. 2. You submit to one script that includes the relevant functions depending on which button is pushed. IF($_POST['submit1']) { include("script1.php"): } or 3. You do it with Javascript since what you actually want to do is on the client, not the server. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: skeller@healthtvchannel.org Web: www.healthtvchannel.org

« previous php.general (#150000) next »