Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML File
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Test query</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script language="JavaScript">
- function toggle(source) {
- checkboxes = document.querySelectorAll("input[name^='box[']");
- for(var i=0, n=checkboxes.length;i<n;i++) {
- checkboxes[i].checked = source.checked;
- }
- }
- </script>
- </head>
- <body>
- <table style="width: 100%; font-size: 11;">
- <tr>
- <th>ve067</th>
- <th>ve378</th>
- <th>ve724</th>
- <th>ve725</th>
- <th>ve726</th>
- <th>ve727</th>
- </tr>
- <tr>
- <td>
- <form method="post" action="update.php">
- <input type="submit" name="update" value="Update - LoL / BoL"><br />
- <input type="checkbox" onClick="toggle(this)" name="All" value="All"> Select all <br />
- <input type="checkbox" name="box[1]" value="ve067_LB1"> LeagueBot 1<br>
- <input type="checkbox" name="box[2]" value="ve067_LB2"> LeagueBot 2<br>
- <input type="checkbox" name="box[3]" value="ve067_LB3"> LeagueBot 3<br>
- <input type="checkbox" name="box[4]" value="ve067_LB4"> LeagueBot 4<br>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
- Update.php file
- <?php
- if(isset($_POST['update'])) {
- if(isset($_POST['box'][1])) {
- echo('run your query here for box1 here');
- } else if(isset($_POST['box'][2])){
- echo('run your query here for box2 here');
- } else if(isset($_POST['box'][3])){
- echo('run your query here for box3 here');
- } else if(isset($_POST['box'][4])){
- echo('run your query here for box4 here');
- } else {
- header("location:test-query.php");
- }
- } else {
- header("location:test-query.php");
- }
Add Comment
Please, Sign In to add comment