Bonjour,
Je voudrais savoir s'il est possible de réaliser une page unique afin d'y regrouper :
- Redirections de pages
- Rewrite des pages
- Title(s) des pages
- META(s) des pages
...
afin de transmettre ensuite ses informations sur chaque page concernée.
J'ai donc créé une page index.php comme ceci :
Comment faire pour que la page appelée ai le bon $pageTitle,$description,$keywords ?
Avez-vous des liens explicatifs svp ?
Merci d'avance.
Modifié par lordbdp (24 May 2020 - 20:53)
      
      
    Je voudrais savoir s'il est possible de réaliser une page unique afin d'y regrouper :
- Redirections de pages
- Rewrite des pages
- Title(s) des pages
- META(s) des pages
...
afin de transmettre ensuite ses informations sur chaque page concernée.
J'ai donc créé une page index.php comme ceci :
<?php
$id_page = isset($_GET['id_page']) ? intval($_GET['id_page']) : 0; // récupération de la variable passée dans l'URL si elle existe
$pages = array(0 => 'accueil.php',
 1 => 'a_propos.php',
 2 => 'candidature_libre.php',
 3 => 'prestations.php',
 4 => 'planning.php',
 11 => 'cg.php',
 12 => 'contact.php',
 20 => 'espace_membre.php',
 30 => 'inscription1.html',
 //30 => 'inscription_eleve.php',
 31 => 'inscription_enseignant.php',
 32 => 'inscription_auto_ecole.php',
 33 => 'inscription_centre_formation.php', 
 34 => 'inscription_apporteur.php',
 40 => 'informations_eleve.php',
 41 => 'informations_enseignant.php',
 42 => 'informations_auto_ecole.php',
 43 => 'informations_centre_formation.php', 
 44 => 'informations_apporteur.php'); // tableau des pages à inclure
$pageTitle = array(0 => 'Accueil',
 1 => 'A propos',
 2 => 'Candidature Libre',
 3 => 'Prestations',
 4 => 'Planning',
 11 => 'Conditions Générales',
 12 => 'Contact',
 20 => 'Espace membre',
 30 => 'Inscription',
 //30 => 'Inscription eleve',
 31 => 'Inscription enseignant',
 32 => 'Inscription auto-école',
 33 => 'Inscription centre de formation', 
 34 => 'Inscription apporteur d\'affaires',
 40 => 'Informations eleve',
 41 => 'Informations enseignant',
 42 => 'Informations auto-école',
 43 => 'Informations centre formation', 
 44 => 'Informations apporteur d\'affaires'); // tableau des titres à inclure
$description = array(0 => 'Accueil',
 1 => 'A propos',
 2 => 'Candidature Libre',
 3 => 'Prestations',
 4 => 'Planning',
 11 => 'Conditions Générales',
 12 => 'Contact',
 20 => 'Espace membre',
 30 => 'Inscription',
 //30 => 'Inscription eleve',
 31 => 'Inscription enseignant',
 32 => 'Inscription auto-école',
 33 => 'Inscription centre de formation', 
 34 => 'Inscription apporteur d\'affaires',
 40 => 'Informations eleve',
 41 => 'Informations enseignant',
 42 => 'Informations auto-école',
 43 => 'Informations centre formation', 
 44 => 'Informations apporteur d\'affaires'); // tableau des descriptions à inclure
$keywords = array(0 => 'Accueil',
 1 => 'a propos',
 2 => 'candidature Libre',
 3 => 'prestations',
 4 => 'planning',
 11 => 'conditions générales',
 12 => 'contact',
 20 => 'espace membre',
 30 => 'inscription',
 //30 => 'inscription,eleve',
 31 => 'inscription,enseignant',
 32 => 'inscription,auto-école',
 33 => 'inscription,centre de formation', 
 34 => 'inscription,apporteur d\'affaires',
 40 => 'informations,eleve',
 41 => 'informations,enseignant',
 42 => 'informations,auto-école',
 43 => 'informations,centre formation', 
 44 => 'informations,apporteur d\'affaires'); // tableau des mots clés à inclure
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>e-Central</title>
</head>
<body>
<?php
if (file_exists($pages[$id_page])) {
    include($pages[$id_page]);
} else {
    echo "Cette page n'est pas accessible actuellement.";
}
?>
</body>
</html>Comment faire pour que la page appelée ai le bon $pageTitle,$description,$keywords ?
Avez-vous des liens explicatifs svp ?
Merci d'avance.
Modifié par lordbdp (24 May 2020 - 20:53)