I'm trying to make a website like this in PHP if possible:
1. It will be multilanguage website
When you enter the site there will be 3 or 4 flags. When you click on
the English flag, the entire website will be in English or if you want
it to be French you click on the French flag and everything will be in
(I think I could figure this out by myself but any help would be much
2. Now this is the hard part. At least for me.
In the right bottom corner there would be a map of Europe with all of
the countries. And when you'd go over a country with your mouse a flag
and a country name would show up on the map and in the left top corner
a description of this country (some text).
Help me please!
they should give you a hand.
You must keep track of the preferred language somehow. For that you
could use a session variable.
Then all your output is put in a language array or as constants -
perhaps one file for each language. If you use a language array you
could use an assosiative array like this:
$language['hello'] = "Hello";
$language['welcome'] = "Welcome;
$language['hello'] = "Bon jour";
$language['welcome'] = "some french";
$language['hello'] = "Hei";
$language['welcome'] = "Velkommen";
And so forth and so on
And in your script you call them as a ordinary variable and in
session['language'] you store the chosen language and includes correct
$_SESSION['language'] included norwegian.php
print $language['hello']; // outputs "Hei"
The other option is also using sessions, but here you use constants
instead of an array.
DEFINE('HELLO', 'Bon jour');
DEFINE('WELCOME', 'some french');
calls it like this: