My default language is german. It will be so defined in the main site:
main.php
<?
$lang = 'ge';
include("set_la nguage.php");
?>
st_language.php
<?php
if (isset($_GET['lang']))
{
$lang = $_GET['lang'];
}
require("lang.{ $lang}.inc.php" );
?>
<td align="left" width="50"><a href="?lang=ge" ><? echo "DEUTSCH"
?></a></td>
<td align="left" width="50"><a href="?lang=en" ><? echo "ENGLISH"
?></a></td>
<td align="left" width="50"><a href="?lang=sp" ><? echo "ESPAÑOL"
?></a></td>
If I call another page it works pretty fine:
.....
<td><a href="breweries .php?lang=<? echo $lang ?>&code=<? echo
$countries[$x][0] ?>"><? echo $countries[$x][1] ?></a></td>
The problem is that, when I want to come back from breweries.php, I get
main.php again in german and that's so because I set at the beginning
$lang as 'ge'. But if I don't do that, I get an error. Is there a way
to define the default value of this variable outside the programm?
Note: I'm quite new in PHP.
Thank you! Bettina
main.php
<?
$lang = 'ge';
include("set_la nguage.php");
?>
st_language.php
<?php
if (isset($_GET['lang']))
{
$lang = $_GET['lang'];
}
require("lang.{ $lang}.inc.php" );
?>
<td align="left" width="50"><a href="?lang=ge" ><? echo "DEUTSCH"
?></a></td>
<td align="left" width="50"><a href="?lang=en" ><? echo "ENGLISH"
?></a></td>
<td align="left" width="50"><a href="?lang=sp" ><? echo "ESPAÑOL"
?></a></td>
If I call another page it works pretty fine:
.....
<td><a href="breweries .php?lang=<? echo $lang ?>&code=<? echo
$countries[$x][0] ?>"><? echo $countries[$x][1] ?></a></td>
The problem is that, when I want to come back from breweries.php, I get
main.php again in german and that's so because I set at the beginning
$lang as 'ge'. But if I don't do that, I get an error. Is there a way
to define the default value of this variable outside the programm?
Note: I'm quite new in PHP.
Thank you! Bettina
Comment