Advertisement
gidmakus

checkboxes

Mar 24th, 2011
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php session_start();
  2. include("include/conn_db.php");        
  3. if( isset( $_POST['approved'] ) ) { // when the button is click to appove
  4.      if ( $_POST['approve'] ) { // if the field is checked
  5.  
  6.           $sql = "update hi_renewal_license SET status='Renewed' where status='pending'";
  7.            
  8.       $result = mysql_query($sql,$connection) or die( "connect error ".mysql_error() );
  9.      }
  10.         else if (!$result) {
  11.             header("Location:../login.php");           
  12.             //echo "Sorry, there has been a technical hitch. Entering details failed.<BR>";//exit;
  13.    } else {
  14.         $logged_in = $userid;
  15.         $_SESSION['logged_in'] = $logged_in;
  16.         unset($_SESSION['error_message']);
  17.         header("Location:../administrator.php");
  18.   } // nested if clause
  19. }// head if statement
  20. ?>
  21.  
  22. this is the part which loops from the while loop:
  23.  
  24.             echo "<input name='approve' type='checkbox' />";
  25.             echo "</td></tr>";
  26.     }
  27.  
  28. This are the two buttons which checks and uncheck the field
  29. <input type='button' onClick=\"SetAllCheckBoxes('check', 'approve', true);\" value=All><input type='button' onClick=\"SetAllCheckBoxes('check', 'approve', false);\" value=None>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement