Advertisement
commandrea

Pass checkbox values to next page

May 19th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <?php error_reporting(E_ALL | E_STRICT);
  2. ini_set('display_errors', 1); session_start();
  3. ?>
  4. <?php include 'conVol.php'; ?>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8.  
  9. </head>
  10.  
  11.  
  12. <body>
  13. <?php include("header.php"); ?>
  14. <div id="main_wrap">
  15.  
  16. <div id="wrap_one">
  17.  
  18. <div class="container_wrap">
  19.  
  20. <div id="header" class="black">
  21. <img src="images/headers/mainheader.png" />
  22. </div>
  23.  
  24.  
  25. <form method="post" action="2012bandScheduleDisplay.php" id="2012bandSched">
  26.  
  27. <div id="bandSchedWrap" class="aqua">
  28. <div class="saturdaySched full_width light_gray">
  29. <div style="padding:20px">
  30.  
  31. <h2>SATURDAY</h2>
  32.  
  33. <div id="stage1sat" class="stageBox">
  34. <h3>STAGE 1</h3>
  35. <?php
  36.  
  37.  
  38. $sql = "SELECT * FROM bandSched WHERE day='saturday' AND stage='stage 1'";
  39. mysql_query($sql);
  40. $result_Sat1 = mysql_query($sql);
  41.  
  42. while($row = mysql_fetch_array($result_Sat1))
  43. {
  44. echo "<ul><li>";
  45. echo '<input type="checkbox" name="id[]" value="'.$row['id'].'"/>';
  46. echo ' '.$row['timeShow'] . " " .$row['bandName'];
  47. echo "</li></ul>";
  48.  
  49. }
  50.  
  51.  
  52. ?>
  53.  
  54. </div>
  55.  
  56.  
  57. </div>
  58. </div>
  59. <div class="clear"></div>
  60. <table width="400">
  61.  
  62. <tr>
  63. <td>CLICK TO FINISH.</td>
  64. <td width="35" colspan="1" style="padding-left:10px"><input value="Submit" type="image" src="images/submitx.png" id="submit" width="35" align="middle"/></td></tr>
  65. </table>
  66.  
  67. </div>
  68.  
  69. </form>
  70.  
  71. <div class="full_width orange">
  72. <!-- Column 1 start -->
  73. <img src="images/contactTop.png" />
  74. <!-- Column 1 end -->
  75. </div>
  76. <?php include("footer.php"); ?>
  77.  
  78.  
  79.  
  80.  
  81.  
  82. 'process.php'
  83.  
  84.  
  85. <?php
  86. if ( ! empty($_POST['id']))
  87. {
  88. $in = implode(', ', $_POST['id']);
  89. $sql = "SELECT * FROM bandSched WHERE id IN ($in) ORDER BY FIELD (id, $in)";
  90. $result = mysql_query($sql);
  91. }
  92. if ( ! isset($result))
  93. {
  94. echo 'You did not select anything';
  95. }
  96. else
  97. {
  98. while ($row=mysql_fetch_assoc($result))
  99. {
  100. echo $row['timeShow'];
  101. echo $row['bandShow'];
  102. }
  103. }
  104. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement