Forum Moderators: coopster
I am building my 3rd or 4th fairly basic PHP and MySQL site, and in building a content management system the need has arised for the following:
A form which has two submit (or similar) buttons at the bottom. What i want is when buttonA is pressed, the form POSTs the data to buttonA.php, and when buttonB is pressed, POST the data to buttonB.php and so on.
I am not sure how I can do this as as far as i know, where the form is POSTed to is defined in the action rather than the button itself. I am fairly new to this so if you could help i would be very grateful.
Cheers
Richard
if(isset($_POST['buttonA']))
header("Location: buttonA.php?varA=".$A."&varB=".$B);
else if (isset($_POST['buttonB']))
header("Location: buttonB.php?varA=".$A."&varB=".$B);