I am trying to change languages but stay on the current page: i.e:
www.myurl.com/english/aboutus.php
www.myurl.com/german/aboutus.php
www.myurl.com/french/aboutus.php
So only the language directory changes. I have the following but can't get it to work:
<?php
$full_url = $_SERVER['FULL_URL'] ;
$temparray = explode(".com/",$full_url,2);
$englishtemp = $temparray[0] . ".com/english/" . $temparray[1];
$englishlink = "<a href=$englishtemp><img src=../images/english-flag.jpg></a>";
echo $englishlink;
?>
I get the url to change from '/french/aboutus.php' to '/english' but it doesn't remember the page name 'aboutus.php' and returns to the index page.
Could any one please help?