";
echo "$temperatuur
";
//echo "$voltage
";
// echo "$sample_tijd
";
echo database_open(HOST,USER,PASSWORD,DBNAME);
$columnames = array('temperatuur','spanning');
$values = array($temperatuur,$voltage);
echo database_insert('temperaturen',$columnames,$values);
//controleren of database kleiner dan 20 (testen) waardes heeft.
$controle_database = database_read('temperaturen','tijd','tijd', 'DESC');
$size_database = count($controle_database);
if($size_database > 20)
{ while($size_database > 20)
{ database_delete('temperaturen','tijd',$controle_database[$size_database - 1]);
$size_database -= 1;
}
}
}
//voor putty raw http verkeer.
//http://developers.sun.com/mobility/midp/ttips/HTTPPost/
/*
POST /login.jsp HTTP/1.1
Host: www.mysite.com
User-Agent: Mozilla/4.0
Content-Length: 27
Content-Type: application/x-www-form-urlencoded
userid=joe&password=guessme
POST index.php HTTP/1.1
Host: www.gatze.cdromke.nl
//User-Agent: Mozilla/4.0
Content-Length: 27 //hoeft waarschijnlijk niet
Content-Type: application/x-www-form-urlencoded //hoeft waarschijnlijk niet
userid=joe&password=guessme //over te sturen data
Content-Type: application/octet-stream //rauwe data
POST /atmel.php HTTP/1.1
Host: www.gltronics.nl
Content-Length: 12
Content-Type: application/x-www-form-urlencoded
atmel=23678001
*/
?>