salut
je souhaiterais que quand un personne entre un numero d'identification, qui existe dans la BDD mysql, ça emmene directement l'utilisateur vers une autre page
bon, j'ai utlisé un header, mais ya quand meme un probleme..
voici le code du petit formulaire :
Code : 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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 ? session_start(); if (!empty ($_POST['id_stagiaire'])) { $_SESSION['id_stagiaire']= $_POST['id_stagiaire']; } echo "<html> <head> <body font bgcolor = #C0C0C0> <font face=papyrus > <b> <title>Identification</title></head> <body bgcolor=#99ccff> <table align=center border=2 bordercolor=white cellpadding=5> <h3 align=\"center\"><B>Veuillez vous enregistrer :</b></h3> <table align=\"center\" border=2 bordercolor=white cellpadding=5> <form method= 'post' action=login.php> <tr><td><font color='black' size=4>votre identifiant :</td><td><input type='text' name='id_stagiaire'></td></tr> < <tr><td colspan=2><center><input type='submit' value='ENTRER'></form></td></tr></FORM> </table> <br><br> </form></td></tr></CENTER> <font face =\"comic sans ms\"> <tr><td colspan=2><center> </table> <br><br> </body> </html>"; ?>
puis le code en php :
voilà thks
Code : 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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 <html> <body font bgcolor = C0C0C0> <font face=papyrus > <b> </body> </html> <? session_start(); session_id(); $_SESSION['id_stagiaire']= $_POST['id_stagiaire']; $id_stagiaire = $_POST['id_stagiaire']; echo "<head> <title>Identification</title></head><body bgcolor=#99ccff>"; $base=mysql_connect("localhost","root", "ko"); mysql_select_db('ji', $base); $identification = mysql_query("SELECT id_stagiaire FROM stagiaire", $base); while ($valeur_ident = mysql_fetch_array($identification)) { //met ces valeurs sous forme de tableau $id_stagiaire_mysql = $valeur_ident['id_stagiaire']; if ($id_stagiaire == $id_stagiaire_mysql) { header ("location : presence.php"); } } echo "</body>"; echo "</HTML>"; ?>
Partager