JahGlory
11.12.2004, 17:04:50
Hallo,
will auf meiner Seite eine index Seite mit Sprachauswahl ( http://www.justchill.de/test/index.php ), dann soll eine textdatei mit allen texten für die Seite geladen werden. Das krieg ich ja auch hin aber ich schaffe es nicht die Sprachvariable weiterzuleiten und die dementsprechende Textdatei jedesmal bwreit zu stellen, hier meine scripte:
1.Index.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><a href="home.php?lang=de">Deutsch</a></td>
<td align="center"><a href="home.php?lang=en">English</a></td>
</tr>
</table>
</body>
</html>
2.Home.php ( http://www.justchill.de/test/home.php?lang=de )
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if ($_GET['lang'] == "en") {
$file="english.txt"; }
if ($_GET['lang'] == "de") {
$file="deutsch.txt"; }
if (!isset($_GET['lang'])) { #wenn keine sprache ausgewählt wird ==> deutsch
$file="deutsch.txt"; }
?>
<?php
$fp=fopen($file,"r");
$c=fgets($fp,1000);
$eintrag=explode(";",$c);
?>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" ><a href="home.php?lang='.$_GET['lang'].'">Home</a></td>
<td width="75%"> </td>
</tr>
<tr>
<td width="25%" ><a href="kontakt.php?lang='.$_GET['lang'].'">Kontakt</a></td>
<td width="75%"><?php print_r ($eintrag); ?></td>
</tr>
<tr>
<td width="25%"><a href="impressum.php?lang='.$_GET['lang'].'">Impressum</a></td>
<td width="75%"><?php echo $eintrag[1]."<br>"; ?></td>
</tr>
</table>
</body>
</html>
3.z.B. Impressum.php ( http://www.justchill.de/test/impressum.php?lang='.$_GET['lang'].' )
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$fp=fopen($file,"r");
$c=fgets($fp,1000);
$eintrag=explode(";",$c);
?>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" ><a href="home.php?lang='.$_GET['lang'].'">Home</a></td>
<td width="75%"> </td>
</tr>
<tr>
<td width="25%" ><a href="kontakt.php?lang='.$_GET['lang'].'">Kontakt</a></td>
<td width="75%"><?php echo $eintrag[4]."<br>"; ?></td>
</tr>
<tr>
<td width="25%"><a href="impressum.php?lang='.$_GET['lang'].'">Impressum</a></td>
<td width="75%"><? echo $eintrag[3]."<br>"; ?></td>
</tr>
</table>
</body>
</html>
will auf meiner Seite eine index Seite mit Sprachauswahl ( http://www.justchill.de/test/index.php ), dann soll eine textdatei mit allen texten für die Seite geladen werden. Das krieg ich ja auch hin aber ich schaffe es nicht die Sprachvariable weiterzuleiten und die dementsprechende Textdatei jedesmal bwreit zu stellen, hier meine scripte:
1.Index.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><a href="home.php?lang=de">Deutsch</a></td>
<td align="center"><a href="home.php?lang=en">English</a></td>
</tr>
</table>
</body>
</html>
2.Home.php ( http://www.justchill.de/test/home.php?lang=de )
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if ($_GET['lang'] == "en") {
$file="english.txt"; }
if ($_GET['lang'] == "de") {
$file="deutsch.txt"; }
if (!isset($_GET['lang'])) { #wenn keine sprache ausgewählt wird ==> deutsch
$file="deutsch.txt"; }
?>
<?php
$fp=fopen($file,"r");
$c=fgets($fp,1000);
$eintrag=explode(";",$c);
?>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" ><a href="home.php?lang='.$_GET['lang'].'">Home</a></td>
<td width="75%"> </td>
</tr>
<tr>
<td width="25%" ><a href="kontakt.php?lang='.$_GET['lang'].'">Kontakt</a></td>
<td width="75%"><?php print_r ($eintrag); ?></td>
</tr>
<tr>
<td width="25%"><a href="impressum.php?lang='.$_GET['lang'].'">Impressum</a></td>
<td width="75%"><?php echo $eintrag[1]."<br>"; ?></td>
</tr>
</table>
</body>
</html>
3.z.B. Impressum.php ( http://www.justchill.de/test/impressum.php?lang='.$_GET['lang'].' )
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$fp=fopen($file,"r");
$c=fgets($fp,1000);
$eintrag=explode(";",$c);
?>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" ><a href="home.php?lang='.$_GET['lang'].'">Home</a></td>
<td width="75%"> </td>
</tr>
<tr>
<td width="25%" ><a href="kontakt.php?lang='.$_GET['lang'].'">Kontakt</a></td>
<td width="75%"><?php echo $eintrag[4]."<br>"; ?></td>
</tr>
<tr>
<td width="25%"><a href="impressum.php?lang='.$_GET['lang'].'">Impressum</a></td>
<td width="75%"><? echo $eintrag[3]."<br>"; ?></td>
</tr>
</table>
</body>
</html>