redirection vers une page
Posté : 05 juil. 2008, 14:07
Bonjour, voila j'ai un soucis avec mon code. En fait j'ai deux pages php (index.php et authentif.php), quand je veux aller sur ces pages, le navigateur se balade entre les deux et n'en finit plus. Alors qu'il devrai rester sur authentif.php. Voici d'abord le code de index.php:
ensuite voila le code de authentif.php:
A mon avis le problème se situe au niveau de windows.location, mais je ne suis pas sur?Merci d'avance[/php]
Code : Tout sélectionner
<?php session_start(); ?>
<!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>
ensuite voila le code de authentif.php:
Code : Tout sélectionner
<?php
ob_start("ob_gzhandler");
if(!($PHPSESSID))
{echo"<script>window.location.href='./index.php'</script>";}
else
{session_start();
?>
<!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 } ?>
A mon avis le problème se situe au niveau de windows.location, mais je ne suis pas sur?Merci d'avance[/php]