$fields = array('co_name', 'co_no', 'vat_no', 'colour', 'athenaemail', 'athenaemailpw', 'emailsmtpsrv'); 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 = ''; // Update Address table $addsid = db_updateAddress($_POST, 100); # Update DB $ownerUpdate = new Owner(); $ownerUpdate->setOwnerid(100); $ownerUpdate->setCo_name($_POST['co_name']); $ownerUpdate->setVat_no($_POST['vat_no']); $ownerUpdate->setCo_no($_POST['co_no']); $ownerUpdate->setAthenaemail($_POST['athenaemail']); $ownerUpdate->setAthenaemailpw($_POST['athenaemailpw']); $ownerUpdate->setEmailsmtpsrv($_POST['emailsmtpsrv']); $res = $ownerUpdate->updateDB(); header("Location: index.php?updateOwner=" . $res); exit; } // Define elements for the HTML Header include $pagetitle = "Edit Your Company Details"; include "tmpl/header.php"; $owner = siteDets(); ?> <h1>Edit Your Company Details</h1>