RE: [PHP] submitting to differient php scripts based on button -O T-

2003-06-04 Thread Jay Blanchard
[snip]
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 buttonshow do i set it?
[/snip]

Instead of 3 different .php why not use one.php with a SWITCH statement?

http://us3.php.net/manual/en/control-structures.switch.php

HTH!

Jay

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-06-04 Thread Steve Keller
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 buttonshow 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: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php