Redirection

Résolu/Fermé
dannezri Messages postés 53 Date d'inscription vendredi 24 juillet 2015 Statut Membre Dernière intervention 8 août 2017 - 20 mars 2016 à 18:47
 Utilisateur anonyme - 20 mars 2016 à 21:57
Bonjour,
Je voudrais faire une redirection après que l'utilisateur s'est identifié.Voici le code de ma page... mais pour l'instant quand on rentre les bons identifiants la page ne fait que se rafraîchir

<!doctype html>
<?php
$Username = "guest";
$Password = "pass";

if(!isset($_POST['Username']) OR !isset($_POST['Password'])) {
?>
<html>
<head>
<meta charset="UTF-8">
<title>Connexion</title>


<link rel="stylesheet" href="css/reset.css">

<link rel='stylesheet prefetch' href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900|RobotoDraft:400,100,300,500,700,900'>
<link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'>

<link rel="stylesheet" href="css/style.css">




</head>

<body>


<!-- Mixins-->
<!-- Pen Title-->
<div class="pen-title">

<p align="center">
<img src="logo2.png" alt="IsraPlay" style="width:256px;height:163px;">
</p>
</div>
<div class="container">
<div class="card"></div>
<div class="card">
<h1 class="title">Identifiez-vous</h1>
<form method ="post" action ="#">
<div class="input-container">
<input type="text" name="Username" id="Username" required="required"/>
<label for="Username">Username</label>
<div class="bar"></div>
</div>
<div class="input-container">
<input type="password" name="Password" id="Password" required="required"/>
<label for="Password">Password</label>
<div class="bar"></div>
</div>
<div class="button-container">
<button type="submit" value="go"><span>Go</span></button>
</div>

</form>
</div>

</div>

<script src="js/index.js"></script>




</body>
</html>




<?php
}


else{

if ($_POST ['Username'] == $Username && $_POST['Password'] == $Password){

?>
<html>
<head>
<meta http-equiv="refresh" content="0; url=index.html" />
</head>
</html>
<?php
}

else{

echo "Identifiants ou mot de passe incorrect";

}
}

?>




Merci

1 réponse

Utilisateur anonyme
20 mars 2016 à 21:57
C'est si dur que ça de taper redirection php dans google ?

<?php
header('Location: mapage.php');
?>
0