";
//checks see if there logged in
if(!$logged[id])
{
echo "You MUST Log In to create a new challenge!";
exit();
}
elseif($logged[id])
{
//querys the db to find the username
$getuser = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'");
//gets rid of bad stuff from the notes
$notes = addslashes(htmlspecialchars($notes));
//check to see if any fields were left blank
if((!$_POST[dmtype]) || (!$_POST[dmloc]) || (!$_POST[head]) || (!$_POST[chest]) || (!$_POST[legs]) || (!$_POST[shield]) || (!$_POST[gloves]) || (!$_POST[boots]) || (!$_POST[ring]) || (!$_POST[weapon]) || (!$_POST[cape]) || (!$_POST[food]) || (!$_POST[potions]) || (!$_POST[other])) {
echo "ALL Fields MUST be filled out in order to continue!";
//posts all the data from the register form
$rsname = $_POST[rsname];
$dmtype = $_POST[dmtype];
$dmloc = $_POST[dmloc];
$headl = $_POST[head];
$chest = $_POST[chest];
$legs = $_POST[legs];
$shield = $_POST[shield];
$gloves = $_POST[gloves];
$boots = $_POST[boots];
$ring = $_POST[ring];
$weapon = $_POST[weapon];
$cape = $_POST[cape];
$food = $_POST[food];
$potions = $_POST[potions];
$other = $_POST[other];
$cmblvl = $_POST[cmblvl];
$notes = $_POST[notes];
//adds them to the db
$adduser = mysql_query("INSERT INTO `deathmatch` (`rsname`, `dmtype`, `dmloc`, `head`, `chest`, `legs`, `shield`, `gloves`, `boots`, `ring`, `weapon`, `cape`, `food`, `potions`, `other`, `cmblvl`, `notes`) VALUES('$rsname', '$dmtype', '$dmloc', '$head', '$chest', '$legs', '$shield', '$gloves', '$boots', '$ring', '$weapon', '$cape', '$food', '$potions', '$other', '$cmblvl', '$notes')");
echo "