Page 1 sur 1

redirection vers une page

Posté : 05 juil. 2008, 14:07
par DamienMalo
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:

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>&nbsp;</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]

Posté : 05 juil. 2008, 14:27
par katagoto
Tu posts à deux endrois pour le même problème...c'est pas utile surtout que ton problème se situe au niveau de ta procédure PHP

Posté : 07 juil. 2008, 12:25
par Ryle
Modération :
DamienMalo, le multipostage est interdit sur le forum.

Merci de prendre le temps de lire les règlements.


:arrow: http://www.phpfrance.com/forums/voir_re ... php#254717