<?php
session_start();
if (isset($_POST['language'])) {
$selectedLanguage = $_POST['language'];
// Save the selected language in the session
$_SESSION['lang'] = $selectedLanguage;
// Respond with a success message
echo "Language saved successfully!";
} else {
// Respond with an error message
echo "Invalid language selection.";
}
?>
|