$dir_fax = $fax_path['dirname']; //get the domain_uuid from the database $sql = "select * from v_domains "; $sql .= "where domain_name = '" . $domain_name . "' "; $prep_statement = $db->prepare($sql); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as &$row) { //set the domain variables $domain_uuid = $row["domain_uuid"]; $_SESSION["domain_uuid"] = $row["domain_uuid"]; $_SESSION["domain_name"] = $domain_name; //set the setting arrays $domain = new domains(); $domain->db = $db; $domain->set(); } unset($prep_statement); //get the fax details from the database $sql = "select * from v_fax "; $sql .= "where domain_uuid = '" . $_SESSION["domain_uuid"] . "' "; $sql .= "and fax_extension = '{$fax_extension}' "; $prep_statement = $db->prepare($sql); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as &$row) { //set database fields as variables //$fax_email = $row["fax_email"]; $fax_uuid = $row["fax_uuid"]; $fax_accountcode = $row["fax_accountcode"]; $fax_pin_number = $row["fax_pin_number"];