J'ai u probleme avec ma fonction voila mon code d'authentification :
Voila ma page de connexion :
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 <?php session_start(); $connexion = mysql_pconnect("***.sql.free.fr","***","***"); mysql_select_db("***", $connexion); $pseudo="'".mysql_escape_string($_REQUEST['pseudo'])."'"; $mdp=mysql_escape_string($_REQUEST['mdp']); $resultat=mysql_query("SELECT * FROM formulaire WHERE login=$pseudo",$connexion); if ($resultat) { $users=mysql_fetch_array($resultat); if ($users["pwd"] == $mdp) { $_SESSION["valid_user"]==1; header('Location: index1.php'); } else { header('Location: authentification.html'); } } else { header('Location: authentification.html'); } ?>Et voila mon index1 :
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<!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> <title>Connexion au site</title> <link href="connexion.css" rel="stylesheet"> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body> <div id="corps"> <div class="titre"><p>Entrez votre login et votre mot de passe : </p></div> <form action="authentification.php" method="post" enctype="multipart/form-data"> <div><label>Login : </label><input type="text" name="pseudo" maxlength="20"/></div> <div><label>Mot de passe : </label><input type="password" name="mdp" /></div><br /> <p><a href="formulaire-inscription.html">S'inscrire</a></p> <div><input type="submit" value="Entrer" /><input type="reset" value="Réinitialiser" /></div> </form> </div> <div id="pied"> <p>Nous sommes le <?php echo date("d/m/Y"); ?> </body> </html>
Voila le message d'erreur :
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 <?php session_start(); if($_SESSION["valid_user"]==1){ ?> <!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"> <head> <title>Le rugby</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link title="Le rugby" href="index1.css" rel="stylesheet" type="text/css" /> </head> <body> <form enctype="multipart/form-data" action="recherche.php" method="post"> <div id="en_tete"></div> <div id="menu"> <div class="sous_menu"> <h3>La coupe du monde</h3> <ul> <li><a href="Les poules.php">Les poules</a></li> <li><a href="Les tableaux finaux.php">Les tableaux finaux</a></li> <li><a href="L'histoire.html">Histoire de la coupe du monde</a></li> </ul> </div> <div class="sous_menu"> <h3>Le top 14</h3> <ul> <li><a href="Top14.html">Tout sur le Top 14</a></li> </ul> </div> <div class="sous_menu"> <h3>Quelques liens utiles</h3> <ul> <li><a href="http://www.ffr.fr/index.php/ffr/accueil__1" onclick="window.open(this.href); return false;">Fédération francaise de rugby</a></li> <li><a href="http://fr.rugbyworldcup.com/" onclick="window.open(this.href); return false;">Site de l'IRB</a></li> </ul> </div> </div> </div> <div id="corps"> <h2>Bienvenue sur mon site</h2> <p>Bonjour! Mon nom est Kevin et je suis passionné de rugby depuis que je suis tout petit.</p> <p>Si vous vous interessez au rugby, vous trouverez sur mon site une foule d'informations utiles. Le site est organisé en trois catégories : <div class="presentation"><ol><li>La coupe du monde</li><li> Le top 14</li><li>Des liens utiles</li></ol></div></p> <p>Ce site ludique a été créé dans le cadre de mon option web.</p> </div> <div class="recherche"> <h2 id="recherche">Recherche de joueur</h2> <div> <label for="recherche"></label> <input name="recherche" type="text" onClick= "javascript:this.value=''" value="Tapez le nom d'un joueur." />***** </div> <div> <input type="submit" value="Rechercher" /> </div> <div class="joueur"> <input type="radio" name="format" value="nom" id="nom" checked="checked"/> <label for="nom">Nom du joueur</label> <input type="radio" name="format" value="prenom" id="prenom"/> <label for="prenom">Tous les joueurs ayant ce prénom</label> </div> </div> <div id="pied_de_la_page"> <p>Code et design par Kevin.2007. <br /> N'hésitez pas a <a href="mailto:X@Y.Z">me contacter</a> si vous voulez discuter du rugby!</p> </div> </form> </body> </html> <?php } else { header ("Location: connexion.php"); } ?>Je ne comprends pas car si je met tout ça avec l base de données de mon prof et donc son adresse cela marche...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 Warning: session_start() [function.session-start]: open(/mnt/163/sdb/1/a/kplanchon/sessions/sess_016eaebf8e940d9eac7337939a414172, O_RDWR) failed: No such file or directory (2) in /mnt/163/sdb/1/a/kplanchon/index1.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /mnt/163/sdb/1/a/kplanchon/index1.php:2) in /mnt/163/sdb/1/a/kplanchon/index1.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mnt/163/sdb/1/a/kplanchon/index1.php:2) in /mnt/163/sdb/1/a/kplanchon/index1.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /mnt/163/sdb/1/a/kplanchon/index1.php:2) in /mnt/163/sdb/1/a/kplanchon/index1.php on line 80 Warning: Unknown(): open(/mnt/163/sdb/1/a/kplanchon/sessions/sess_016eaebf8e940d9eac7337939a414172, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/163/sdb/1/a/kplanchon/sessions) in Unknown on line 0
Partager