2006-07-11 03:44:14 +00:00
|
|
|
<?php
|
2006-07-11 19:24:12 +00:00
|
|
|
require_once("docutil.php");
|
2006-07-11 03:44:14 +00:00
|
|
|
require_once("poll.inc");
|
2006-07-11 19:24:12 +00:00
|
|
|
require_once("poll_data.inc");
|
|
|
|
|
|
|
|
function error() {
|
|
|
|
page_head("Error - results not recorded");
|
|
|
|
echo "An internal error has prevented us from recording
|
|
|
|
your survey response. Please try again later.
|
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
exit();
|
|
|
|
}
|
2006-07-11 03:44:14 +00:00
|
|
|
|
|
|
|
mysql_pconnect("localhost", "boincadm", null);
|
|
|
|
mysql_select_db("poll");
|
|
|
|
|
2006-07-11 21:56:53 +00:00
|
|
|
session_set_cookie_params(86400*365);
|
2006-07-11 03:44:14 +00:00
|
|
|
session_start();
|
|
|
|
$uid = session_id();
|
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
$x = parse_form();
|
|
|
|
$xml = generate_xml($x);
|
2006-07-11 03:44:14 +00:00
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
$response = select_response($uid);
|
|
|
|
if ($response) {
|
|
|
|
$result = update_response($uid, $xml);
|
|
|
|
} else {
|
|
|
|
$result = new_response($uid, $xml);
|
2006-07-11 03:44:14 +00:00
|
|
|
}
|
2006-07-11 19:24:12 +00:00
|
|
|
if ($result) {
|
|
|
|
page_head("Survey response recorded");
|
|
|
|
echo "Thank you for completing the BOINC user survey.\n ";
|
|
|
|
page_tail();
|
|
|
|
} else {
|
|
|
|
error();
|
2006-07-11 03:44:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|