title: i am making an online attendance system
body: <pre><code>    &lt;?PHP
          session_start();
          $_SESSION["teacher"] = "tech01";
          echo "Favorite teacher is " . $_SESSION["teacher"] . ".&lt;br&gt;";
          include 'db.php';
          ?&gt;
          &lt;html&gt;
          &lt;head&gt;&lt;/head&gt;
              &lt;body&gt;
              &lt;?php
              if(isset($_POST['submit']))
              {
              $inst=$_POST['inst'];
              $sub=$_POST['sub'];
              $view_student="select s_name from students where s_inst='$inst' AND 
              s_sub='$sub' ";
              $run=mysqli_query($dbcon,$view_student);    
              echo "&lt;form name='form' action='atte.php' method='post'&gt;";  
              echo '&lt;input type="date" name="att"&gt;'; // currently for future use
              echo "&lt;/br&gt;";
              while($row=mysqli_fetch_array($run)){
              $name=$row['s_name'];
              echo '&lt;input type="checkbox" name="present" &gt;';
              echo "&lt;label&gt;" .$name. "&lt;/label&gt;";
              echo "&lt;input type='hidden' name='stun' value='".$name."'/&gt;";
              echo "&lt;input type='hidden' name='inst' value='".$inst."'/&gt;";
              echo "&lt;input type='hidden' name='sub' value='".$sub."'/&gt;";
              echo '&lt;input type="submit" value="Submit_attendance" 
              name="insert"&gt;';
              echo "&lt;br&gt;";
              }
              echo "&lt;/form&gt;";}
  ?&gt; 
  </code></pre>
  
  <p>Whenever I mark the student present, it marks all student present and how can I save it?
  This is the code for online attendance management system.</p>