how can i change the form action dynamically suppose( temp.php,temp1.php,temp3.php)etc. in a press one submit button.
Give me the idea anyone
| SitePoint Sponsor |
how can i change the form action dynamically suppose( temp.php,temp1.php,temp3.php)etc. in a press one submit button.
Give me the idea anyone


You could set up a switch() function to control the action depending on an incoming variable.
Can you explain how the form is going to be controlled?
example switch:
PHP Code:$action = $_GET['action']; // action coming from a URL....
switch($action) {
case 'temp1' :
$form_action = 'temp1.php';
break;
case 'temp2' :
$form_action = 'temp2.php';
break;
case 'temp3' :
$form_action = 'temp3.php';
break;
default :
$form_action = 'temp.php';
break;
}
echo '<form name="myform" action="'. $action .'" method="post" />';
// etc
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!
it is working but first time clicking it is not possible,second time clicking it should go in specific page.
how it is solve ?


Can you tell us what you are trying to do and why? That way we can give you a better answer!
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!
Bookmarks