Hello Guys I am trying to create an attendace system for that I went throught a simple and easiest process which I was thinking is good way but any one cacn let me know where I am doing mistake that when I click on timein the values are not insterting in the database.
Database structure:
pre_id timein p_date
Auto Inc time date
Insert_presence.php
<?php
error_reporting(0);
include_once('connection.php');
date_default_timezone_set("US/Arizona");
$user_id = 2;
$date = date('y-m-d');
$timein = $_POST['timein'];
$query = mysql_query("insert into presence(user_id, timein, p_date)
values('$user_id', '$timein', '$date')");
header("Location: ../home.php");
?>
timein.php
<?php $time = date('h:i:s'); ?>
<form action="includes/insert_presence.php" method="POST">
<input type="submit" value="TIME IN" name="time_in" class="time" />
<div class="clear"></div>
<input type="hidden" name="timein" value="<?php echo $time; ?>" />
<p><?php echo date('h:i:s A'); ?></p>
</form>
Please help me out with this consirn