Method One:
<Divclass= "Container theme-showcase"role= "Main"> <formclass= "Form-horizontal"Method= "POST"Action= "<?php echo base_url ("manage/audit/user ");?>"><Divclass= "Form-group"> <labelclass= "Col-sm-2 Control-label">User name</label> <Divclass= "Col-sm-10"> <Pclass= "Form-control-static"><?php echo $user [' user_name '];?></P> </Div> </Div> ................................ <HR> <Divclass= "Row"> <Divclass= "Col-xs-6"><Buttontype= "Submit"name= "Audit_btn"value= "PASS"class= "btn btn-success pull-right">Audit through</Button></Div> <Divclass= "Col-xs-6"><Buttontype= "Submit"name= "Audit_btn"value= "NoPass"class= "btn btn-danger pull-left">Audit does not pass</Button></Div> </Div> <inputtype= "hidden"name= "user_id"value= "<?php echo $user [' user_id '];?>" /> </form></Div> <!--/container -
/** * User Audit*/ Public functionAudit_user () {$audit _btn=$this->input->post (' audit_btn ',TRUE); if("PASS" = =$audit _btn) { //Audit through $user _audit_status= ' audited '; //Message Content $msg= ' User certification audit has passed, please click to view the status of certification! ‘; } if("nopass" = =$audit _btn){ //audit does not pass $user _audit_status= ' audit_failed '; $msg= ' User authentication audit failed, please click to view the status of certification! ‘; } $user _id=$this->input->post (' user_id ',TRUE); .............................. }
Method Two:
You can set the button to a name example:
<input type= "Submit" name= "Submit" value= "Submission"/>
<input type= "Submit" Name= "Submit2" value= "Submit 2" >
If it is a post submission
In PHP, you can use the
<?php
if (!empty ($_post[' submit ')) {
Echo ' Click to submit ';
} elseif (!empty ($_post[' submit2 ')) {
Echo ' Click is submit 2 ';
}
?>
A form of 2 buttons, PHP background How to determine which button is submitted