set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]); $purifier = new HTMLPurifier($purifier_config); // Check for a contact ID if (!isset($_GET['id']) && !intval($_GET['id'])) { header("Location: contacts.php"); exit(); } $contact_id = intval($_GET['id']); $sql_contact = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_email, contact_primary, contact_technical, contact_billing, contact_auth_method FROM contacts WHERE contact_id = $contact_id AND contact_client_id = $session_client_id AND contacts.contact_archived_at IS NULL LIMIT 1"); $row = mysqli_fetch_array($sql_contact); if ($row) { $contact_id = intval($row['contact_id']); $contact_name = nullable_htmlentities($row['contact_name']); $contact_email = nullable_htmlentities($row['contact_email']); $contact_primary = intval($row['contact_primary']); $contact_technical = intval($row['contact_technical']); $contact_billing = intval($row['contact_billing']); } else { header("Location: portal_post.php?logout"); exit(); } ?>