-
Notifications
You must be signed in to change notification settings - Fork 0
/
validationChangementMotdepasse.php
54 lines (50 loc) · 1.98 KB
/
validationChangementMotdepasse.php
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
<?php
include_once 'mesFonctions.php';
$error = "" ;
$token = "";
$email = "";
# quand on arrive la première fois sur la page, il s'agit du token et email passé dans l'URL
if (isset($_GET["token"]) && isset($_GET["email"])) {
if(!empty($_GET['token']) && !empty($_GET['email'])) {
$token = $_GET["token"];
$email = $_GET["email"];
}
}
# quand on valide le formulaire
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit']) && isset($_POST['email']) && isset($_POST['token'])){
if(!empty($_POST['email']) && !empty($_POST['token'])){
$token = $_POST["token"];
$email = $_POST["email"];
header("Location: newPassword.php?token=$token&email=$email");
die();
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Espace</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/style2.css">
</head>
<body>
<?php include_once 'header.php';?>
<section id="section-connection">
<fieldset>
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" autocomplete="off">
<h2>Validation de votre demande de changement de mot de passe</h2>
<h3>(simulation lien sur email)</h3>
<div class="connection-bienvenue">
<h1>Veuillez valider votre demande en cliquant sur le bouton ci-dessous :</h1>
</div>
<input type="hidden" id="token" name="token" value="<?php echo $token ?>"/>
<input type="hidden" id="email" name="email" value="<?php echo $email ?>"/>
<input type="submit" name="submit" value="VALIDER"/>
</form>
</fieldset>
</section>
<?php include_once 'footer.php';?>
</body>
</html>