Here is my code in php. I have a php creditcard confirmation page, with 2 button, edit details and submit. I have an init file which will perform tasks based on what cc_confirm is and what editval is, confirm and editing details respectively.
if($_POST['cc_confirm1']=='y' && $_POST['$editval']!='y' && !isset($editval))
{echo '<input name="submitbtn" type="submit" value="Edit Details" /><input name="editval" type="hidden" value="y" /><input name="cc_confirm" type="hidden" value="n" />';
}
if($_POST['cc_confirm1']=='y' && $_POST['$editval']!='y' && !isset($editval)){
echo '<input name="submitbtn1" type="submit" value="Submit Card" /><input name="card1" type="hidden" value="y" /><input name="cc_confirm" type="hidden" value="y" />';
Now the problem is, because I am using two hidden items, always the one at the bottom is being executed. For this code, if i press on edit details, the details are being submitted, the credit card is being runned and then edit page is shown after that, which does not serve the purpose.
If i interchange both button codes, then even for submit card, it is showing only edit page details without submitting card. I have tried to change the name of the buttons but no use.How can i avoid this problem? Appreciate any effort to solve.