I'm having problems with some PHP code that I implemented on a site. It worked when I handed everything over, but after a few months - probably PHP updates, it stopped working. (Not entirely sure of the versions when I made it, but now it's PHP Version 5.2.12-nmm1)
In more detail:
It is a bilingual site, and has duplicate HTML files for both languages, e.g.:
.../eng/index.html
.../deu/index.html
To switch between languages, I implemented the following code (this example is from what appears on the EN version):
<div class="loweAutomobil" id="language">English | <?php $myUrl = "http://".$SERVER_NAME.$REQUEST_URI; $alternativeUrl = preg_replace("/eng/","deu",$myUrl); echo "<a href= ".$alternativeUrl.">Deutsch</a>"; ?></div>
For some reason, it doesn't work anymore as it should (i.e. display "Deutsch" as a link with the current 'eng' in the URL replaced by 'deu').
Instead it goes to: http:localhost/
Does anyone have any ideas as to why? How can I fix it?
You can view the site here: http://loeweautomobil.de/eng/index.html
Thank you for your time!