par
crash » 06 juil. 2008, 11:30
Salut,
Ben disons que déjà tes deux pages ne sont pas trop compréhensible.
De plus ta variable $PHPSESSID elle te sert à quoi ?
tu la récupère dans quelle page, dans la page authentif2.php non ?
Si c'est le cas tu n'as pas besoin de faire tout celà :
index.php
Code : Tout sélectionner
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Imprimerie Castel</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="imagetoolbar" content="no">
<script>
if(self!=top)top.location=self.location;
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
</script>
</head>
<body>
<script>window.location='authentif.php'</script>
</body>
</html>
authentif.php
<?php
ob_start("ob_gzhandler");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Imprimerie Castel</title>
<link rel="stylesheet" type="text/css" href="reuze.css">
<script type="text/javascript" src="config.js"></script>
</head>
<body>
<table style="width:100%;height:80px;background-color:#ffffff;border-width:0 0 1px 0;border-style:solid;border-color:#4444FF;" cellspacing="0" cellpadding="0">
<tr>
<td width="500" align="center" valign="bottom"><img src="./images/logotitre.gif"></td>
<td> </td>
</tr>
</table>
<center>
<h2>Authentification</h2>
<br><br>
<form method="post" action="authentif2.php">
veuillez saisir votre mot de passe : <input type="password" name="login" size="30" maxlength="30"> <input type="submit" value="valider">
</form>
</center>
</body>
</html>
Après moi j'aurais fais une vérification voir si le mot de passe est bon ou non.
Genre, si le mot de passe est bon alors tu ouvres la session, sinon tu rediriges dans la page authentif.php .
Salut,
Ben disons que déjà tes deux pages ne sont pas trop compréhensible.
De plus ta variable $PHPSESSID elle te sert à quoi ?
tu la récupère dans quelle page, dans la page authentif2.php non ?
Si c'est le cas tu n'as pas besoin de faire tout celà :
index.php
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Imprimerie Castel</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="imagetoolbar" content="no">
<script>
if(self!=top)top.location=self.location;
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
</script>
</head>
<body>
<script>window.location='authentif.php'</script>
</body>
</html>
[/code]
authentif.php
[php]
<?php
ob_start("ob_gzhandler");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Imprimerie Castel</title>
<link rel="stylesheet" type="text/css" href="reuze.css">
<script type="text/javascript" src="config.js"></script>
</head>
<body>
<table style="width:100%;height:80px;background-color:#ffffff;border-width:0 0 1px 0;border-style:solid;border-color:#4444FF;" cellspacing="0" cellpadding="0">
<tr>
<td width="500" align="center" valign="bottom"><img src="./images/logotitre.gif"></td>
<td> </td>
</tr>
</table>
<center>
<h2>Authentification</h2>
<br><br>
<form method="post" action="authentif2.php">
veuillez saisir votre mot de passe : <input type="password" name="login" size="30" maxlength="30"> <input type="submit" value="valider">
</form>
</center>
</body>
</html>
[/php]
Après moi j'aurais fais une vérification voir si le mot de passe est bon ou non.
Genre, si le mot de passe est bon alors tu ouvres la session, sinon tu rediriges dans la page authentif.php .