using form input in different pages and handling actions dynamically

i have four files. they are index.php,commonform.php,image1.php,image2.php

suppose , in the index .php i have a form with two image input. the form’s action change dynamically,method is post. when the first image is clicked is goes to commonform.php and also when the second image is clicked is goes to commonform.php.but is commonform i have a form with some somebutton input(its work can be anything and not my concern) and a submit button. my concern is,when the first image is clicked, it goes to commonform.php and when the submit button is clicked of commonform.php, it goes to image1.php and same things for when the second image is clicked, it goes to commonform.php and when the submit button is clicked of commonform.php, it goes to image2.php. Can anyone help me??

Shouldn’t be. What makes the forms actions dynamic? You should be just routing this to a single controller and based on the inputs, direct the user to the location, not making your for dynamic like that.

The rest of you post, I haven’t a clue what you are trying to explain.

Sponsor our Newsletter | Privacy Policy | Terms of Service