Bonjour à tous,

n'ayant rien trouvé sur l'internet qui m'ait réellement aidé, je poste ici mon problème en espérant qu'une bonne âme éclaire ma lanterne

J'ai un fichier Language.php qui recherche dans ma Bdd les traductions de mes noms de page et de mes titres de page. Ce fichier crée dynamiquement des constantes globales en fonction de la langue utilisée.

Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
 
//on recherche si on a déjà quelque chose pour cette langue
$query_AllDetailsConstant = "SELECT * FROM `".$DiminutifBD."pages_details` WHERE Language= '". ucfirst($Language) ."' ";
$AllDetailsConstant = mysqli_query($connexion,$query_AllDetailsConstant) or die(mysqli_error($connexion));
$row_AllDetailsConstant = mysqli_fetch_assoc($AllDetailsConstant);
$totalRows_AllDetailsConstant = mysqli_num_rows($AllDetailsConstant);
 
do{
 
        define("MENU_".$row_AllDetailsConstant['IdPage']."_".strtoupper($row_AllDetailsConstant['Language']) ,$row_AllDetailsConstant['DenominationPage']);
 
	define("MENU_".$row_AllDetailsConstant['IdPage']."_TITLE_".strtoupper($row_AllDetailsConstant['Language']) ,$row_AllDetailsConstant['Title']);
 
 
}while($row_AllDetailsConstant = mysqli_fetch_assoc($AllDetailsConstant));

Ce fichier Language.php est inclus dans mon fichier Page.php. Ce fichier, Page.php, affiche les informations reprises dans ces constantes globales en fonction de l'ID de page reçu.

Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
 
              $VarConst	=	MENU_.$IdPage._; echo "<H1>".constant($VarConst.$LangConstante)."</H1>";
	      $VarConst	=	MENU_.$IdPage._TITLE_; echo "<H2>".constant($VarConst.$LangConstante)."</H2>";

Depuis le passage du serveur en Php 7.2, le message d'erreur suivant s'affiche:

Warning: Use of undefined constant MENU_ - assumed 'MENU_' (this will throw an Error in a future version of PHP)
Ma variable s'affiche néanmoins bien suite à ce message d'erreur. D'où mon incompréhension !?

Si quelqu'un pouvait m'aider, ce serait bien sympa car je commence à m'arracher les cheveux :p