<?php
$filename = 'c_leitura.php';

if (!file_exists($filename)) {
  header("Location: error.php"); exit;   
}				
include 'c_leitura.php';

require_once("db.php");

$idprod = $_POST['idprod'];
$platform = $_POST['platform'];
$version = $_POST['version'];
$text = mysql_real_escape_string ($_POST['text']);

$query = "INSERT INTO crashlog (datetime, idprod, platform, version, text) VALUES (now(), '$idprod', '$platform', '$version', '$text')";
$result = mysql_query ($query) or die(mysql_error()); 

echo ($result);
?>

