languageCode = $_POST['my_lang']; // Add this as first option, selected $options[] = '\n"; // Remove, so it is not listed two times unset($langs[$_POST['my_lang']]); } // We have received a cookie and it is an available language elseif (isset($langs[$userPreferences->languageCode])) { // Add this as first option, selected $options[] = '\n"; // Remove, so it is not listed two times unset($langs[$userPreferences->languageCode]); } // We have no cookie and no form submitted else { // Add this as first option, selected $options[] = "\n"; } // Add all other languages foreach ($langs as $code => $name) { $options[] = '\n"; } // Assemble form from collected data $langpref = "\n"; // Save URL shortcut fallback setting if (isset($_POST['urlsearch'])) { $userPreferences->setUrlSearchType($_POST['urlsearch']); } if (isset($_POST["showug"])) { $userPreferences->setIsUserGroupTipsEnabled($_POST["showug"] === "enable"); } // Prepare mirror array $mirror_sites = $MIRRORS; $mirror_sites["NONE"] = [7 => MIRROR_OK]; $userPreferences->save(); site_header("My PHP.net", ["current" => "community"]); ?>