itdmacar Posted September 9, 2007 Share Posted September 9, 2007 Hi, How do you process if you have forms in your script ? I have form 1 and form 2 in my scripts and their method are both 'POST', my logic is to go back to the same script whenever I click the submit button from my form 1, my problem is whenever I click the select botton and goes back to the same script it does not recognise the other buttons from Form 2. How do I process 2 forms ? Can someone has the sample scripts, please . . . Link to comment https://forums.phpfreaks.com/topic/68623-solved-forms-in-php/ Share on other sites More sharing options...
GingerRobot Posted September 9, 2007 Share Posted September 9, 2007 Something along the lines of: <?php if(isset($_POST['submitbutton1'])){ //process 1st form } if(isset($_POST['submitbutton2'])){ //process 2nd form } //any html headers/css etc ?> <form action=<?php echo $_SERVER['phpself'];?> method="POST"> <?php if(!isset($_POST['submitbutton2'])){ if(!isset($_POST['submitbutton1'])){//neither form submitted //show first form echo '<input type="submit" name="submitbutton1">'; }else{//first form has been submitted //show second form echo '<input type="submit" name="submitbutton2">'; } } ?> Link to comment https://forums.phpfreaks.com/topic/68623-solved-forms-in-php/#findComment-344911 Share on other sites More sharing options...
itdmacar Posted September 9, 2007 Author Share Posted September 9, 2007 Thanks for the quick reply . . . I gonna try it first . . . Link to comment https://forums.phpfreaks.com/topic/68623-solved-forms-in-php/#findComment-344914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.