Question : Do I really need 3 form.php files plus 3 send_form.php files?

Hi. I have three pages with different designs. Each launch the same form in jquery's thickbox. Upon submit the window closes and the user is redirected to a corresponding thank you page. My problem is that I feel like I should be able to have one form.php and one send_form.php that redirects the user to the appropriate page based on the parent page.... I just don't know how to do it.

Any help? My files are attached.
Attachments:
 
My files
 

Answer : Do I really need 3 form.php files plus 3 send_form.php files?

I just noticed that there is no difference between form1, form2 and form3 other than the value 1, 2, or 3. So you might pass these on to the form in the url.

<a href="form.php?formnbr=1">Form 1</a>

Then in form.php get the form number and place it into the form
<input type="hidden" name="formnbr" value="<?php echo ISSET($_REQUEST["formnbr"]) ? $_REQUEST["formnbr"] : 1; ?>">

If you are not familiar with the construct I used in that the expression
x = a ? b : c
will evaluate a and if true return b and if not true will return c
is the same as
if (a) { x = b; } else { x=c; }

Random Solutions  
 
programming4us programming4us