This topic is locked
[SOLVED]

 Header dependent on language?

3/20/2012 12:29:33 PM
PHPRunner General questions
P
Philip author

Hello
I would like to make the header dependent on the choosen language within an PHPR application.

Has someone an idea how to do that?
Thanks,

Philip

C
cgphp 3/20/2012

You can add a conditional statement in the "HTML Mode" of the header (Editor tab).

P
Philip author 3/21/2012

Christian
Thanks but I can't imagine how. Can you advise a bit more in detail please?
Philip

Sergey Kornilov admin 3/21/2012

Here is some sample code:

<?php

if ($_SESSION["language"]=="Spanish")

{

echo "Some Spanish text";

}

else if ($_SESSION["language"]=="French")

{

echo "Some French text";

}

?>


Recommended reading: http://xlinesoft.com/blog/2011/05/05/localizing-phprunnerasprunnerpro-applications/

C
cgphp 3/21/2012

In the "HTML Mode" of the header (Editor tab), you can enter something like this:

<?php

switch($_SESSION['language'])

{

case 'English':

echo 'You have chosen the English language';

break;

case 'French':

echo 'You have chosen the French language';

break;

case 'Spanish':

echo 'You have chosen the Spanish language';

break;

case 'Italian':

echo 'You have chosen the Italian language';

break;

}

?>


PHP open and close tags are mandatory.

P
Philip author 3/21/2012

Thanks - I will try it.