RE: [PHP-DB] Form Actions in PHP

From: Date: Thu, 17 Jul 2003 05:12:19 +0000
Subject: RE: [PHP-DB] Form Actions in PHP
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-29293@lists.php.net to get a copy of this message
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: [PHP-DB] 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

« previous php.db (#29293) next »