$content = stripslashes(urldecode($_POST['content']));
$xmlStr = $content;
if (!isset($xmlStr) || strlen($xmlStr) == 0) {
    exit(0);
}
// exit gracefully
$xml = new SimpleXMLElement($xmlStr);
$samples = $xml->samples;
$user_id = 1;
// anonymous user
$group_id = intval($xml->info->group);
$comment = (string) $xml->info->comment;
$user_name = (string) $xml->info->user_name;
// If a user name was specified, find the user id
if (isset($user_name) && strlen($user_name) > 0) {
    $id = user_find_by_name($user_name);
    if (isset($id)) {
        $user_id = $id;
    } else {
        exit(0);
    }
}
$count = 0;
$duplicate_count = 0;
// JRT line below as is_duplicte not defined error occuring
$is_duplicate = false;
foreach ($samples->sample as $sample) {
    xmlSampleInsert($sample, $user_id, $group_id, $comment, $is_duplicate);
    $count++;
    if ($is_duplicate) {
        $duplicate_count++;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
	
	<?php 
require_once 'db/user.php';
$name = $_POST['user_name'];
$email = $_POST['user_email'];
$password = $_POST['user_password'];
$password_confirm = $_POST['user_password_confirm'];
$error_msg = "";
if ($password != $password_confirm) {
    $error_msg = "Passwords don't match. Please try again.";
}
if ($error_msg == "" && !user_find_by_name($name)) {
}
// create a new account
?>
	
	<?php 
require_once 'page-elements/header.php';
require_once 'page-elements/footer.php';
?>

	<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Pollution Monitor</title>
		<meta name="generator" content="TextMate http://macromates.com/">
		<meta name="author" content="Nik Youdale">
		<!-- Date: 2010-03-05 -->