<?php


	
	$mac 	= htmlspecialchars($_GET["mac"]);//"18FE34CC1D23"
	$term 	= htmlspecialchars($_GET["term"]);//"humd";
	$before = htmlspecialchars($_GET["before"]);//"1494860440000";
	$after  = htmlspecialchars($_GET["after"]);//"1494849664000";

	$ch = curl_init("https://devapi.fauv.io/v1/sensordata?term=".$term."&mac=".$mac."&before=".$before."&after=".$after);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // allows output to be saved to variable

	$result = curl_exec($ch); //save output to variable
	curl_close($ch);

	fclose($fp);

	echo $result;
?>
