Adding meta to header

Permalink
Hello,

is a problem with Multi-Language in C5, so I decide to use the php_execute block and write some code to determine users browser language.
Now I wanna put an header information and redirect depend on the language.

// Accept Language from Browser
$browserAcceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
// Set Language
$RedirectorLanguage = 'sk';
if (substr($browserAcceptLanguage,0,2) == 'de') {
        $RedirectorLanguage = 'de';
} else {
        $RedirectorLanguage = 'sk';
}
// check if the user has received an Session Cookie from my LangRedirector
if (!isset($_SESSION['RedirectorLanguage']))
        $_SESSION['RedirectorLanguage'] = $RedirectorLanguage;
// Redirect to language specific Page
$host  = $_SERVER['HTTP_HOST'];
$uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');


I thought the Controller Class which calls the View Class to add the meta Informations, but nothing happens. Nothing will appear in the source code from the browser.

Where is my mistake?
Thx in advance.
Peter

 
synlag replied on at Permalink Reply
synlag
You could use your .htaccess for redirecting.
This is pretty easy.
See

http://de.selfhtml.org/servercgi/server/htaccess.htm#alternative_in...

Greets
eparser replied on at Permalink Reply
I'm not so familiar with .htaccess.
I'd like more to add it in the code itself. A good side effect is to learn how this cms is working internally.

Cheers
Remo replied on at Permalink Reply
Remo
I don't think you should use the php_execute block for to solve this problem.

It's the wrong place to put such a code in. I know that c5 doesn't have a lot of multi language features yet but I would consider checking the core and contacting Andrew in case you've found a possible solution...