<div class="lang">Language:<a href="?lang=en">English</a>|<a href="?lang=ru">Russian</a></div>
populated with the block .
$result = mysql_query("SELECT * FROM stores_".$_SESSION['lang']);
about.php?lang=enthe switch is fine.
/shop.php?type=stores&id=25&lang=enwhen clicking on the language switch there is a link to
shop.php?lang=en no type=stores&id=25which is not correct and leads to the error on the page.
echo substr($_SERVER['REQUEST_URI'], 0, -8);to find the url and cut off the excess since the url was 2 times wrote to lang=en or lang=EN but this causes problems on pages type about.php?lang=en (trims extra).