<?php 
require_once('Connections/localhost.php'); 

mysql_select_db($database_localhost,$localhost);
date_default_timezone_set('Etc/GMT-8');

$userIDI = $_POST['Email'];
$password = $_POST['Password'];
//$ID = $_POST['Id'];
$dateToday = date('d-m-Y', time());
$timeNow = date('h:i:s a', time());
$action = "login";
$query_search = "select * from tbl_user where user_ID = '".$userIDI."' AND password = '".$password. "'";
$query_exec = mysql_query($query_search) or die(mysql_error());
$rows = mysql_num_rows($query_exec);
$rowValue = mysql_fetch_array($query_exec);
//$query1 = mysql_query("select * from tbl_user where username = '111' AND password = '111'");
//$row = mysql_fetch_array($query1);
$userID = $rowValue['user_ID'];
$userName = $rowValue['username'];
if($rows --> 0) { 
$result = mysql_query("insert into recordofuser (user_ID,username,udate,utime,uaction) value ('$userID','$userName','$dateToday','$timeNow','$action')");
$result2 = mysql_query("insert into tempid (user_ID) value ('$userID')");
echo "Y";
//echo "".$row['username']."";
//mysql_query("Insert into mydatabase.tbl_user values('$ID','$useremail','$password')");
}
else  {
echo "N";
}
 //echo "<script language='javascript'>alert(".$row['username'].")</script>";
?>