questionnaire.php
<?php
 
if(!isset($_GET['q']) || !isset($_GET['v']) || !isset($_GET['a'])) return;
 
$qq = $_GET['q'];
$qv = $_GET['v'];
$qa = $_GET['a'];
 
$db = new PDO('sqlite:questions.sqlite');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = $db->prepare("REPLACE INTO responses(q,v,a) VALUES(:qq, :qv, :qa)");
try {
 $query->execute(array(':qq' => $qq, ':qv' => $qv, ':qa' => $qa));
}
catch(PDOException $e) {
 die($e->getMessage());
}
print "OK";
 
?>