diff options
Diffstat (limited to 'accroche.php')
| -rw-r--r-- | accroche.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/accroche.php b/accroche.php new file mode 100644 index 0000000..7fd0994 --- /dev/null +++ b/accroche.php | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?php | ||
| 2 | // PAGE SÉCURISÉE ! impossible de la voir si la variable $_SESSION['mdpvalide'] ne vaut pas 1 | ||
| 3 | |||
| 4 | session_start(); | ||
| 5 | if (isset ($_SESSION["mdpvalide"])) | ||
| 6 | { | ||
| 7 | if($_SESSION["mdpvalide"]) // booléen, test si ça vaut 1 | ||
| 8 | {} // dans ce cas on fait rien et on laisse php lire la suite | ||
| 9 | else | ||
| 10 | { | ||
| 11 | header('Location: connexion.php'); | ||
| 12 | exit (); | ||
| 13 | // exit() sert à interrompre php qui n'a alors surtout pas besoin d'aller jusqu'en bas de la page | ||
| 14 | } | ||
| 15 | } | ||
| 16 | else | ||
| 17 | { | ||
| 18 | header('Location: connexion.php'); | ||
| 19 | exit (); | ||
| 20 | } | ||
| 21 | |||
| 22 | $fichier = fopen('accroche.txt','r+'); | ||
| 23 | ftruncate($fichier,0); // évite les problèmes quand on change pour un titre plus court | ||
| 24 | fputs($fichier, $_POST['accroche']); | ||
| 25 | fseek($fichier, 0); | ||
| 26 | fclose($fichier); | ||
| 27 | |||
| 28 | header('Location: administration.php?modifaccroche=1'); | ||
| 29 | exit (); | ||
| 30 | ?> | ||
