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") {
Did you know?Explore Trending and Topic pages for more stories like this.
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

$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat

SAP BCS. BPS
Hi all,

I am seeking reading note on the following in BW

BCS, BPS
ADVANCE

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

Using unserialize()
Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0

Socket problem
Hello,

Earlier I posted about my problem with my socket script. It took up to 100% CPU usage.

CHMOD script
Hi,

I need a script to read all files in a folder and set to 777.

Can anyone help out

comparing tables across databases sql refinement ideas required
Hi all

Via pl/sql I need to ensure that data between tables in different databases match

please fix the error
What is the error in the below code ???
Line number On/Off | Expand/Contract <?php

Javascript or not?
How many people prefer javascript/ajax sites? How many prefer the good old fashion straight php sit

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