<Td> <a href = "/member/life/edit_ppt/<? Php echo $ v-> id;?> "Class =" btn "> edit </a> <a href =" javascript:; "onclick =" if (confirm ('Are you sure you want to delete this record? ') {Location. href ='/member/life/del_ppt/<? Php echo $ v-> id;?> ';} "Class =" btn "> Delete </a> </td>
Note: If the header ('location:/member/life/shop/') is used in the php script for redirection, I want to output the prompt information before redirecting to the page, cannot be implemented with header () (no output can be provided before this function). You can also use js to implement echo "<script> alert ('Operation successful! '); Location. href ='/member/life/add_shop/'; </script> ";
If alert outputs garbled characters, you must first confirm the file encoding format, and then add the following header ("Content-Type: text/html; charset = UTF-8") before echo ");