if(isset($_SESSION['lang'])){
$_SESSION['lang'] = 'ru';
}
include_once('lang'.$_SESSION['lang'].'.php');
<a href="/lang.php?lang=en">English</a>
<a href="/lang.php?lang=ru">Русский</a>
if(isset($_GET['lang'])){
$_SESSION['lang'] = $_GET['lang'];
}
header('location: /');
<a data-target="modal">Open modal</a>
<a data-target="sidebar">Toggle sidebar</a>
<a data-target="test" class="link" id="testLink">Test link</a>
$(document).on('click', '[data-target]', function() {
var $target = $(this).data('target');
if($target == 'modal') {
//open modal
} else if($target == 'sidebar') {
//toggle sidebar
} else if($target == 'test') {
var $class = $(this).attr('class'); // 'link'
var $id = $(this).attr('id'); // 'testLink'
//.... и т.д.
}
});