Example code for LAMP server (mf-web08s)

with No Comments

The following example script assuming the database "dbname" has a table "dbtable" with fields for storing uid, date, time, and system datetime.


if (!mysql_connect($db_host,$db_user,$db_pwd)) {
  die( "Unable to connect host");

if (!mysql_select_db($db_name)) {
  die( "Unable to select database");

$st=date('Y-m-d H:i:s',$now);

$dt=$date . ' ' . $time;

echo "<html><body>";
if ($cmd=="CO") {
  $query = "INSERT INTO $db_table VALUES ('$uid','$dt','$st','$cmd')";
  echo "<AVEA>" // start flag
  echo "CK=$st"; // set clock
  echo "GRNT=01"; // granting access
  echo "</AVEA>"; // end flag
echo "</body></html>";