Précédent   Forum des professionnels en informatique > PHP > Langage > Sessions
Sessions Forum d'entraide sur les sessions avec PHP. Avant de poster -> FAQ sessions, Cours sessions et Sources sécurité
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 05/12/2007, 10h29   #1
Candidat au titre de Membre du Club
 
Inscription : octobre 2007
Messages : 49
Détails du profil
Informations forums :
Inscription : octobre 2007
Messages : 49
Points : 13
Points : 13
Par défaut Probleme de sessions sous apache 2.2.6

Bonjour,
J'ai un probleme avec les sessions sous apache 2.2.6 sachant que le meme code sous easyphp 1.8 ca marche bien. voici une partie du code:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
	session_name("DT");
	session_start();
	if(isset($_SESSION['Connecter']) && $_SESSION['Connecter'] == "ok")
	{
		?>
			<script type="text/javascript">location.href = 'index.php?cp=5';</script>
		<?
	}
?>
//code html
else {
	echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Veuillez saisir le nom d'utilisateur</p>";
						}
					}
				?>
			</div>
		</div>
	</div>
	<div style="clear:both">
</body>
</html>
super-java est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2007, 12h30   #2
Membre émérite
 
Avatar de sharrascript
 
Homme Franck
Développeur Web indépendant
Inscription : avril 2007
Messages : 678
Détails du profil
Informations personnelles :
Nom : Homme Franck
Âge : 31
Localisation : France, Rhône (Rhône Alpes)

Informations professionnelles :
Activité : Développeur Web indépendant

Informations forums :
Inscription : avril 2007
Messages : 678
Points : 900
Points : 900
bonjour,

Quel est le problème??
__________________
LudiKreation Pour un web ludique et son Blog | CapRumbo pour un peu d'évasion | ChaOdisiaque Club Passion Rôliste |SierrElben le Jeu de rôle
sharrascript est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2007, 13h27   #3
Candidat au titre de Membre du Club
 
Inscription : octobre 2007
Messages : 49
Détails du profil
Informations forums :
Inscription : octobre 2007
Messages : 49
Points : 13
Points : 13
Par défaut Probleme de sessions sous apache 2.2.6

Le probleme c que la page ne s'affiche pas et si on enleve le code des sessions la page ca marche bien
super-java est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2007, 13h51   #4
Membre émérite
 
Avatar de sharrascript
 
Homme Franck
Développeur Web indépendant
Inscription : avril 2007
Messages : 678
Détails du profil
Informations personnelles :
Nom : Homme Franck
Âge : 31
Localisation : France, Rhône (Rhône Alpes)

Informations professionnelles :
Activité : Développeur Web indépendant

Informations forums :
Inscription : avril 2007
Messages : 678
Points : 900
Points : 900
tu n'as aucun message d'erreur??

Peut tu nous faire voir une plus grande partie du code de cette page...? Car tu as des crochets en trop, donc je suppose qu'il y a d'autres conditions au dessus.
__________________
LudiKreation Pour un web ludique et son Blog | CapRumbo pour un peu d'évasion | ChaOdisiaque Club Passion Rôliste |SierrElben le Jeu de rôle
sharrascript est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2007, 14h42   #5
Candidat au titre de Membre du Club
 
Inscription : octobre 2007
Messages : 49
Détails du profil
Informations forums :
Inscription : octobre 2007
Messages : 49
Points : 13
Points : 13
Par défaut Probleme de sessions sous apache 2.2.6

Ok voici tout le code de la page:
Code :
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 
<?php
session_name("DT");
session_start();
if(isset($_SESSION['Connecter']) && $_SESSION['Connecter'] == "ok")
{
?>
<script type="text/javascript">location.href = 'index.php?cp=5';</script>
<?
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/style.css" type="text/css"/>
<link href="libs/style4bis.css" rel="stylesheet" type="text/css" media="screen" title="style"/>
<script  type="text/javascript" src="libs/js.js"></script>
</head>
<body>
<div id="entete">
<div id="entete_gauche"></div>
</div>
<div id="milieu">
<div id="menu1">
</div>
<div style="margin:30px 0 0 200px;border:solid 2px #0b55aa; height:300px;width:590px">
<p style="text-align:center;font-size:24px;margin-top:10px;font-weight:bold;color:#0c5599;">
Authentification</p>
<div style="background-color:#f5f5f5;margin:15px 0 0 50px;height:200px;width:500px">				
<form method="post" action = "authentification.php?cp=5&<?php echo session_name().'='.session_id()?>"> 
<div style="margin:25px 4px 0 120px !important; margin:50px 4px 0 41px;float:left;">
<label style="color:#0c5599;" for="login">Nom d'utilisateur:</label>		
</div>
<div id="log"  >
<input style="margin-top:25px !important;margin-top:46px;" type="text" name="login" id="login"/>
</div>
<div style="margin:10px 0 0 120px !important;margin:10px 0 0 85px;">
<label style="color:#0c5599;" for="passwd">Mot de passe:</label>					
<input style="margin-left:19px" type="password" name="passwd" id="passwd"/>
</div>					
<div style="margin:8px 0 0 200px">
<input type="submit" value="Connexion" name="connexion" style="height:24px;width:85px;font-size:14px"/>
</div>
</form>
<?php
if(isset($_POST['connexion']) && $_POST['connexion'] !=""){
if(isset($_POST['login']) && $_POST['login']!="")
{
	if(isset($_POST['passwd']) && $_POST['passwd']!="")
	{
		$login=$_POST['login'];
		$passwd=$_POST['passwd'];
		mysql_connect("localhost","root","visite_dt");
		mysql_select_db("bd_visite");
		/*$requete="select * from inspecteur where  login='".$login."' and password ='".$passwd."'";
		echo "r= ".$requete;*/
		$requete="select * from inspecteur where  login='".addslashes($login)."' and password ='".addslashes($passwd)."'";
		/*echo "r= ".$requete;
		$resultat = NULL;*/
		$resultat = mysql_query($requete);
		if($resultat)
		{
			if($row = mysql_fetch_row($resultat))
			{
				$_SESSION['Connecter'] = "ok";
				$_SESSION['MatriculInspect'] = $row[0];
				$_SESSION['NumDelegation'] = $row[1];
				$_SESSION['NumCircon'] = $row[2];
				$_SESSION['NomInspect'] = $row[3];
				$_SESSION['PrenomInspect'] = $row[4];
			?>
				<script type="text/javascript">location.href = 'index.php?cp=5';</script>
			<?php										
			}
			echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Le nom d'utilisateur ou le mot de passe est incorrect.</p>";
		}
		else
		{
			echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Le nom d'utilisateur ou le mot de passe est incorrect.</p>";
		}
	}
	else{
		echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Veuillez saisir le mot de passe</p>";
?>
<script type='text/javascript'>
x="<input style='margin:26px 0 0 2px !important;margin:47px 0 0 2px' type='text' value='<?php echo $_POST['login']; ?>' name='login' id='login' value='eeeeeee'/>";	
di = document.getElementById("log");
di.innerHTML = x;
</script>
<?php
	}
}
else {
	echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Veuillez saisir le nom d'utilisateur</p>";
}
}
?>
</div>
</div>
</div>
<div style="clear:both">
</body>
</html>
super-java est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2007, 15h05   #6
Membre émérite
 
Avatar de sharrascript
 
Homme Franck
Développeur Web indépendant
Inscription : avril 2007
Messages : 678
Détails du profil
Informations personnelles :
Nom : Homme Franck
Âge : 31
Localisation : France, Rhône (Rhône Alpes)

Informations professionnelles :
Activité : Développeur Web indépendant

Informations forums :
Inscription : avril 2007
Messages : 678
Points : 900
Points : 900
Tu est sûr que tu n'as pas de message d'erreur?

Car s'il n'y a pas d'erreur, ta page a forcément un contenu.
__________________
LudiKreation Pour un web ludique et son Blog | CapRumbo pour un peu d'évasion | ChaOdisiaque Club Passion Rôliste |SierrElben le Jeu de rôle
sharrascript est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2007, 15h16   #7
Candidat au titre de Membre du Club
 
Inscription : octobre 2007
Messages : 49
Détails du profil
Informations forums :
Inscription : octobre 2007
Messages : 49
Points : 13
Points : 13
oui y a pas d'erreur c ca ce que je ve comprendre l'affichage y a pas
super-java est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 11h11.


 
 
 
 
Partenaires

Hébergement Web