foreach ($fields as $field) { if (!isset($_POST[$field])) { $_POST[$field] = ''; } } // Check if we have Form Data to process if (isset($_GET['go']) && $_GET['go'] == "y") { $logContent = "\n"; // Insert into DB $invoicesNew = new Invoices(); $invoicesNew->setCustid($_POST['custid']); $invoicesNew->setIncept(time()); $invoicesNew->setContent($_POST['content']); $invoicesNew->setPrice($_POST['price']); $invoicesNew->setNotes($_POST['notes']); $invoicesNew->insertIntoDB(); $logresult = logEvent(4, $logContent); header("Location: /invoices/?highlight=" . $result['id']); exit; } // Define elements for the HTML Header include $pagetitle = "Create An Invoice"; $pagescript = array('/pub/js/jquery.js'); $pagestyle = array(); include "../tmpl/header.php"; ?> <h1><?php echo $pagetitle; ?> </h1>