Forum Discussion
<html>
<head>
<title>Log Message HTTP POST Handler</title>
<head>
<?php
// This PHP is for logging any runtime messages to the database
//$StationName = $_REQUEST['FromStation'];
?>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
<?php
$VUserID = $_REQUEST['VUserID'];
$ActionNeeded = $_REQUEST['TxAction'];
$Message = $_REQUEST['LogMessage'];
$con = mysql_connect("localhost", "root", ""); // or die('Error', mysql_error());
if (!$con)
{
die('Could not c onnect: ' . mysql_error());
}
mysql_select_db("LoadCompleteTx");
$query="INSERT INTO `loadcompletetx`.`runlog` (`VUserID`, `TxAction`,`LogMessage`, `TimeIn`) VALUES ('$VUserID', '$ActionNeeded', '$Message', CURRENT_TIMESTAMP);";
if(!mysql_query($query, $con))
{
die ('Error updating database');
}
else
{
print("<p>Success: Logged");
}
mysql_close($con);
?>
<p>
</body>
</html>
Related Content
- 8 years ago
- 8 years ago
- 7 years ago
- 8 years ago
- 4 years ago
Recent Discussions
- 9 months ago
- 2 years ago
- 3 years ago
- 3 years ago