Bonsoir,
Je suis entrain d'apprendre les SESSIONS et j'ai un petit problème. Donc j'ai une page accueil.html je tape mon nom (il y a pas de login) et une autre page (index.php) s'ouvre et j'ai une erreur
Fatal error: Call to undefined function mysqli_string() in
dans le premier fichier accueil.html j'ai
et dans le deuxième fichier index.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <?php session_start(); ?> <html> <body> <form method="POST" action="index.php"> Entrez votre nom : <input type="TEXT" name="prenom"> <input type="SUBMIT" value="OK"> </form> </body> </html>
Merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <?php session_start(); if(isset($_POST['prenom'])){ $prenom = mysqli_string($_POST['prenom']); $_SESSION['prenom'] = $prenom; } if (isset($_SESSION['prenom'])){ //echo 'tu es '.$_SESSION['prenom']; }
Partager