problem with array - multilingual page


Posted on 16th Feb 2014 07:03 pm by admin

this is my test page :
Code: <?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 :
Code: <?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???

No comments posted yet

Your Answer:

Login to answer
134 Like 17 Dislike
Previous forums Next forums
Other forums

Check if another session of the page is running?
I want to keep people from opening multiple tabs, or sessions of my Facebook app. Is it possible to

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

PHP and Javascript
Hello Everyone,

I have a page that needs a javascript code to be written between PHP code but

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

Help with PHP Calendar code...
Hello, I'm new to this forum and I'm glad I found it.
I wrote this code for a PHP calendar as an

Pass sql into pl/sql and create RMAN duplicate script.
Hi,

I'm new to pl/sql and I'm trying to write a script that will generate some RMAN comma

Help with echo()
I'm having some problems with this code:

Code: echo '
<A HREF="jav

IP Logger for Voting Script
Can anybody help me place an IP logger into my voting script?
I know that maybe it is not as secu

Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting.

Converting RGB values to HEX
Code: <?PHP

$file_handle = fopen("colors/rgb.csv", "r");

wh

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash