Jump to content

how to use radio button in attendance system


purple

Recommended Posts

<form action="something.php" method="post">

<input type="radio" name="preferred_color" value="Red" /> Red<br />

<input type="radio" name="preferred_color" value="Blue" /> Blue<br />

<input type="radio" name="preferred_color" value="Green" /> Green<br />

<input type="submit" value="Submit">

</form>

 

example ^

u can edit on your own. ;o

Link to comment
Share on other sites

Thanx sir for your time.
Actually, i want to do like this.This attendance system for school actually. When a teacher chose class, list of student name will appear in a table.
Students and class  are in a database. Besides students's name there will be two radio buttons to chose. Let look at attendance.php
 ____________________________________________________________________________________________________________________
<html>
<table>
    <tr>
    <td><fieldset>
    <legend class="style58"></legend>
    
    <center>
<table width="750" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
    <td width="56"> </td>
    <td width="284"><label></label></td>
    <td width="410"> </td>
</tr>
  <tr>
 <form id="form1" name="form1" method="post" action="attendance display.php">
  <tr>
    <td> </td>
    <td><span class="style57">
      <label>Class</label>
    </span></td>
    <td><select name="class" id="class">
        <option>Please Select</option>
      <option>Yellow</option>
      <option>Black </option>
    </select></td>
    <td> </td>
     
     <tr>
       <td> </td>
       <td align="right"> </td>
       <td> </td>
     </tr>
         
</table>

<p align="center">
       <center>
      <input type="submit" name="Submit" value="Enter"  align="center"/>
      </form></center>
      </p>

</table>
</html>
__________________________________________________________________________________________________________________________________

 

After teacher chose the class, name of student in the class will display in a table with radio buttons. Here the code that i make, but i know i do many mistake on my code.

 

attendance display.php

 

______________________________________________________________________________________________________________________

<form action="index4process.php" method="post">

<table>

<tr>

    <td> </td>

    <td align="right"><div align="left" class="style48"><span class="style8">Date</span></div></td>

  </tr>

    <td> </td>

      <td> </td>

</table>

 

<table border='1' align='center'>

  <tr>

      <th width="30"><font size="2">No</font></th>

   <th width="300"><font size="2">Student's Name</font></th>

   <th width="250"><font size="2">IC Number</font></th>

   <th width="250"><font size="2">Status</font></th>

</tr>

       

                     

<?php

       

mysql_connect("localhost", "root", "")or die(mysql_error());

mysql_select_db("attendance");

 

$a7=$_POST["class"];

$search=mysql_query("SELECT*from student where class='$a7' ")or die (mysql_error());

$nombor=1;

 

    while($data=mysql_fetch_array($search))

   

     $a=$data['nama'];

  $b=$data['no_ic'];

 

?>

          

        <tr>

  <td><?php echo $nombor ?></td>

  <td><?php echo $a ?></td>

  <td><?php echo $b ?></td>  

  <td>

  <input type="radio" name="Present<?php echo $nombor; ?>" value="Present" >Hadir

  <input type="radio" name="Present<?php echo $nombor; ?>" value="Absent">Tidak Hadir

        </td>

   

  </tr>

  <?php

  $no++;

 

                   

    }

           ?>    

    </center> 

   

</table>

<center>

  <label>

  <input type="submit" name="Submit" value="Sent" onSubmit="doSomething()" />

  </label>

  </center>

</form>

______________________________________________________________________________________________________________________

 

With hope..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.