trim($_POST['name']), 'group' => trim($_POST['group']), 'type' => trim($_POST['type']), 'url' => trim($_POST['url']), 'module' => trim($_POST['module']), 'hidden' => isset($_POST['hidden']) ? 1 : 0 ]; $success = ProductModel::createProduct($product); if ($success) { header("Location: dashboard.php?module=product&action=list&added=1"); } else { header("Location: dashboard.php?module=product&action=create&error=1"); } exit; } header("Location: dashboard.php?module=product&action=create"); exit;