Bonjour,
quand j'ouvre page index.php ou admin_login.php sur firefox il m'affcihe
La page n'est pas redirigée correctement

Firefox a détecté que le serveur redirige la demande pour cette adresse d'une manière qui n'aboutira pas.

La cause de ce problème peut être la désactivation ou le refus des cookies
index.php
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
<?php 
session_start();
if(!isset($_SESSION["manager"])){
    header("location:admin_login.php");
    exit();
}
$managerID=  preg_replace('#[^0-9]#i','',$_SESSION["matricule"]);
$manager=  preg_replace('#[^A_Za-z0-9]#i','',$_SESSION["username"]);
$pass=  preg_replace('#[^A_Za-z0-9]#i','',$_SESSION["password"]);
include "connect_to_mysql.php";
$sql=  mysql_query("select * from admin where matricule='$managerID' and username='$manager' and password='$pass' LIMIT 1");
$existCount=  mysql_num_rows($sql);
if($existCount==0){
    header("location:index.php");
    exit();
}
?>
<!DOCTYPE html>
<html lang="fr">
    <head>
        <title>TODO supply a title</title>
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
        <link rel="stylesheet" type="text/css" href="style/style.css" media="all" />
    </head>
 
    <body>
        <div align="center" id="mainWrapper">
            <?php include_once 'template_header.php'; ?>
            <div id="pageContent"><br/>
                <div align="left" style="margin-left:24px;">
                    <h2>Hello</h2>
                    <p><a href="inventory_list.php">Manage Inventory</a><br/>
                    <a href="#">Manage Blah blah</a></p>
                </div>
                <br/><br/><br/>
            </div>
            <?php include_once 'template_footer.php'; ?>
        </div>
    </body>
</html>

admin_login.php
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
<?php 
session_start();
if(isset($_SESSION["manager"])){
    header("location: index.php");
    exit();
}
?>
<?php 
if(isset($_POST["username"]) && isset($_POST["password"])){
    $manager=  preg_replace('#[^A-Za-z0-9]#i','',$_POST["username"]);
    $pass=  preg_replace('#[^A-Za-z0-9]#i','',$_POST["password"]);
    include "connect_to_mysql.php";
    $sql=  mysql_query("select matricule from admin where username='$manager' and password='$pass' LIMIT 1");
    $existCount=  mysql_num_rows($sql);
    if($existCount==1){
        while($row=  mysql_fetch_array($sql)){
            $mat=$row["matricule"];
        }
        $_SESSION["matricule"]=$mat;
        $_SESSION["manager"]=$manager;
        $_SESSION["password"]=$pass;
        header("location:index.php");
        exit();
    }  else {
    echo'That information is incorrect, try again <a href="index.php">Click Here</a>';
    exit();
}}
?>
 
<!DOCTYPE html>
<html lang="fr">
    <head>
        <title>Admin Login</title>
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
        <link rel="stylesheet" type="text/css" href="style/style.css" media="all" />
    </head>
 
    <body>
        <div align="center" id="mainWrapper">
            <?php include_once 'template_header.php'; ?>
            <div id="pageContent"><br/>
                <div align="left" style="margin-left:24px;">
                    <h2>Please Log in to manage the store</h2>
                    <form id="form1" name="form1" method="post" action="admin_login.php">
                        User Name:<br/>
                        <input name="username" type="text" id="username" size="40">
                        <br/><br/>
                        <input name="password" type="password" id="password" size="40">
                        <br/><br/><br/>
                        <label>
                            <input type="submit" name="button" value="Log In">
                        </label>
                    </form>
                    <p>&nbsp;</p>
                </div>
                <br/><br/><br/>
            </div>
            <?php include_once 'template_footer.php'; ?>
        </div>
    </body>
</html>