$name = isset($_POST['name']) ? $_POST['name'] : null; $desc = isset($_POST['desc']) ? $_POST['desc'] : null; $cat = isset($_POST['cat']) ? $_POST['cat'] : null; $img = isset($_POST['image']) ? $_POST['image'] : null; $prep = isset($_POST['prep']) ? $_POST['prep'] : null; $lvl = isset($_POST['lvl']) ? $_POST['lvl'] : false; $price = isset($_POST['price']) ? $_POST['price'] : null; $ing = isset($_POST['ing']) ? $_POST['ing'] : null; $char = isset($_POST['char']) ? $_POST['char'] : null; $fwd = isset($_GET['fwd']) ? $_GET['fwd'] : null; //clean the AS inputs $cat = replaceName(explode(',', $cat), 0); $ing = replaceName(explode(',', $ing), 1); $char = replaceName(explode(',', $char), 2); $data = array( 'name' => $name, 'desc' => $desc, 'cat' => $cat, 'img' => $img, 'prep' => $prep, 'lvl' => $lvl, 'price' => $price, 'ing' => $ing, 'char' => $char ); if( !isset($_SESSION['active']) || !$_SESSION['active'] || $_SESSION['roleid'] > 2 ) {
function directoryName($name) { $name = replaceName($name); $name = strtolower($name); if (strpos($name, 'the ') === 0) { $name = str_replace(" ", "", $name); $name = substr($name, 3); //start with 4th character } else { $name = str_replace(" ", "", $name); } return $name; }