I've got this error on the following code and I'm not able to solve. I've already cheched with hex editor and everything seems to be ok. Can someone help me?
The database in defined in another php file recalled with the include statement at the beginning.
The code is the following:
<?php
// -----------------------------------------------------------
// INCLUSIONE FILE
// ----------------------------------------------------------------------
$GLOBALS['HomeDir']=substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], "")); //Rilevo Home directory
require_once "Include/Include.php"; //Inclusioni generali
if (isset($_GET["id"]) and isset($_GET["variabile"]) and isset($_GET["da"]) and isset($_GET["a"])){
$Nome="storico.csv";
header("Content-Type: application/text");
header("Content-Disposition: attachment; filename=".$Nome);
$Iden=$_GET["id"];
$Variab=$_GET["variabile"];
$Start=$_GET["da"];
$End=$_GET["a"];
if ($GLOBALS['Db']->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($GLOBALS['Db'])
$Database=$GLOBALS['Db']->get_results("SELECT DateTime, Value FROM ".RESTDATA." WHERE (UID = '".$Iden."' AND Field = '".$Variab."' AND DateTime >= '".UnixToMySQLTime($Start)."' AND DateTime <= '".UnixToMySQLTime($End)."' ORDER BY ID ASC;");
}
foreach ($Database as $Data){
print "'".gmdate("d/m H:i", MySQLToUnixTime($Data->DateTime))."';".$Data->Value."n"; //Scrivo in tabella dato
}
?>