<?php include ("connect.php");?>
<?php
date_default_timezone_set('America/Chicago');
$Date = date("Y-m-d H:i:s");
if(isset($_POST['play'])) {
$VID = $_POST['play'];
$UID = $_POST['user'];
$MID = $_POST['mid'];
$Frame = $_POST['frame'];
$type = "play";
// Connects to your Database
//Writes the information to the database
mysqli_query($SMB, "INSERT INTO SMBDU_VideoViews (vid, userID, date, type, frame, mid) VALUES ('$VID', '$UID', '$Date', '$type', '$Frame', '$MID')");
}
if(isset($_POST['pause'])) {
$VID = $_POST['pause'];
$MID = $_POST['mid'];
$UID = $_POST['user'];
$Frame = $_POST['frame'];
$type = "pause";
$PauseTime = date("Y-m-d H:i:s");
// Connects to your Database
//Writes the information to the database
mysqli_query($SMB, "INSERT INTO SMBDU_VideoViews (vid, userID, date, type, frame, mid) VALUES ('$VID', '$UID', '$PauseTime', '$type', '$Frame', '$MID')");
}
if(isset($_POST['end'])) {
$VID = $_POST['end'];
$MID = $_POST['mid'];
$UID = $_POST['user'];
$type = "end";
$EndTime = date("Y-m-d H:i:s");
// Connects to your Database
//Writes the information to the database
mysqli_query($SMB, "INSERT INTO SMBDU_VideoViews (vid, userID, date, type, mid) VALUES ('$VID', '$UID', '$EndTime', '$type', '$MID')");
}
?> |