Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Remove Absence for student</title>
- </head>
- <body>
- <h3>Enter the Check In it to mark absence:</h3>
- <?php
- if(isset($_POST['update']))
- {
- $dbhost = '####';
- $dbuser = '####';
- $dbpass = '####';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass);
- if(! $conn )
- {
- die('Could not connect: ' . mysql_error());
- }
- $check_in_id = $_POST['check_in_id'];
- $sql = "UPDATE check_in SET is_absent=1 WHERE check_in_ID = $check_in_id" ;
- ///////////////////// mysql_select_db('ENTER DABATABE NAME ');
- $retval = mysql_query( $sql, $conn );
- if(! $retval )
- {
- die('Could not delete data: ' . mysql_error());
- }
- echo "Asbsence successfully marked for: $check_in_id \n";
- mysql_close($conn);
- }
- else
- {
- ?>
- <form method="post" action="<?php $_PHP_SELF ?>">
- <table width="400" border="0" cellspacing="1" cellpadding="2">
- <tr>
- <td width="100">Check in ID</td>
- <td><input name="check_in_id" type="number" id="check_in_id"></td>
- </tr>
- <tr>
- <td width="100"> </td>
- <td> </td>
- </tr>
- <tr>
- <td width="100"> </td>
- <td>
- <input name="update" type="submit" id="update" value="Submit">
- </td>
- </tr>
- </table>
- </form>
- <?php
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement