In my footer.php I want to give people the option to change the language from english to german. I want to do this manually, because I have a lot of external links, so I do not want to use plugins since it should be easy with php.
All I need to do is to change the href and the content between the anchor.
<?php
session_start();
if($_SESSION["language_is_german"])
{
echo "<a href='www.example.com?lang=en'>EN</a>";
$_SESSION["language_is_german"] = true;
}
else
{
echo "<a href='www.example.com?lang=de'>DE</a>"
$_SESSION["language_is_german"] = false;
}
?>
This is the way I thought it might work, but it doesn't..