RE: Form Actions in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't know if this got answered yet. I usually do this by checking the
variable before submitting the form and then adjusting the form action.  It
turns out to be a JavaScript problem.

if(variable=="a"){
	document.form.action="location_one.cgi";
}else if(var=="b"){
	document.form.action="location_two.cgi";
}else{
	document.form.action="location_default.cgi";
}



If you need to, or prefer to, check it on the server-side, then you can a
create a form with hidden fields in the first post to hold all the post
data, and then check the variable, then perform a second post using the
onload method to post to the correct program as required.

hth,

Duane

-----Original Message-----
From: Rick Dahl [mailto:dmbserver@hotmail.com]
Sent: Friday, July 18, 2003 10:18 AM
To: php-db@lists.php.net
Subject:  Form Actions in PHP


I have a small problem.  I need to have a form post to two different
locations.  If a variable is a certain value, it goes to location_one.cgi
and if it is another value, it goes to location_two.cgi.  This may turn out
be a html problem but I figured php was the way to go since it is more
dynamic.  Any help is appreciated.

- Rick


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux