Jump to content

problem with array - multilingual page


yami007

Recommended Posts

this is my test page :

<?php 
if(isset($_GET['lang'])) {
	if($_GET['lang'] == "en") {
		require_once("languages/lang-en.php");
	}
	elseif($_GET['lang'] == "fr") {
		require_once("languages/lang-fr.php");
	}
	elseif($_GET['lang'] == "ar") {
		require_once("languages/lang-ar.php");
	}
} else {
	require_once("languages/lang-fr.php");
}
?>
<html>
<head>
	<title><?php echo $lang['title']; ?></title>
</head>
<body>
<div id="content">
	<h1><?php $lang['title']; ?></h1>
	<?php $lang['content']; ?>
	<br/>
</div>
<div id="footer">
	<?php $lang['footer']; ?>
</div>
</body>
</html>

 

and here is my included file :

<?php 
// english version
$lang = array();

$lang['title']      = "Welcome to My site !";
$lang['content']    = "<p>Well this is my first time setting up a multilingual website, i hope it works.</p>";
$lang['footer']     = "All rights reserved for UML (C) ".date("Y", time());
$lang['error']      = "Sorry, you cannot add words unless you're logged in !";
?>

the problem is that page displays the head title only !!!!

what should i do???

Link to comment
https://forums.phpfreaks.com/topic/179731-problem-with-array-multilingual-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.