* */ require_once "src/base.inc.php"; require_once "src/header.inc.php"; echo "
$desc is a required field.
"; } else { $values[$field] = trim($_POST[$field]); } } if ($values['email'] != $values['email2']) { $error .= "Email addresses must match.
"; } if ($_POST['tos'] != '1') { $error .= "You must accept the terms of service.
"; } $category = Category::getByShortname(addslashes($values['category'])); if (!$category) { $error .= "Invalid category.
"; } if ($error == '') { $post = new Post(); $post->setEmail($values['email']); $post->setCategory($category->getId()); $post->setName($values['title']); $post->setDescription($values['description']); // TODO: Set the source of the post. if ($post->save()) { $post->sendValidation(); // TODO: Revise wording. echo "Your posting is awaiting email verification
"; } else { $error .= "An internal error has occured."; } } else { render_form($error); } } else { render_form(); } require_once "src/footer.inc.php"; function render_form($error="") { global $values; if ($error != '') { echo "