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

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a data

remove innitial

and

tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

Expandable Post Code
Hi,

Hope you can help. Which currently I haven't upgraded to connect to a mysql server, so i

gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer a

How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons

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