You need to check if your get parameter langue is set: isset($_GET['langue'])
<?php
if (!isset($_GET['langue'])
{
include('lang/default-lang.php');
}
elseif ($langue == "fr")
{
include('lang/fr-lang.php');
}
elseif ($langue == "en")
{
include('lang/en-lang.php');
}
elseif ($langue == "es")
{
include('lang/es-lang.php');
}
?>
Also in you need to change this line : $langue = $_GET['langue'];
to this:
if (isset($_GET['langue']))
$langue = $_GET['langue'];
UPDATE
You cannot access any GET value that does not exist. First you need to check if it was set. isset($_GET['langue'])
returns true if the parameter was set, so just use this check once at the beginning of your code.
I'd suggest this:
$langue = "";
if (!isset($_GET['langue']){
$langue = $_GET['langue'];
}
then use only $langue
instead of $_GET['langue']
.