summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--page.html6
-rw-r--r--page.php27
2 files changed, 20 insertions, 13 deletions
diff --git a/page.html b/page.html
index 0107626..a147dc8 100644
--- a/page.html
+++ b/page.html
@@ -21,10 +21,12 @@
<h1 id="titre">Système d'exploitation</h1>
<div>
<strong>Questionnaire</strong>
- <form action="page.php">
+ <form action="page.php" method="post">
<p class="formulaire">
- Votre nom :<input type="text" name="nom">
+ Votre nom :<input type="text" name="username">
</p>
+ Mot de passe :<input type="password" name="password">
+
<p class="formulaire">
Votre OS : <select name="os" maxlength=7>
<option label="------"></option>
diff --git a/page.php b/page.php
index f3b3a22..98c2390 100644
--- a/page.php
+++ b/page.php
@@ -7,18 +7,23 @@
<body>
<div>
<?php
- if (isset($_GET['nom']))
- {
- echo "<p>Merci ".$_GET['nom']." !</p>";
- }
- if (isset($_GET['os']))
- {
- echo "<p>Votre OS favori est ".$_GET['os']." !</p>";
- }
- if(isset($_COOKIE['date']))
- {
+if (isset($_POST['password']) && $_POST['password'] == "secret"){
+ if (isset($_POST['username']))
+ {
+ echo "<p>Merci ".$_POST['username']." !</p>";
+ }
+ if (isset($_POST['os']))
+ {
+ echo "<p>Votre OS favori est ".$_POST['os']." !</p>";
+ }
+ if(isset($_COOKIE['date']))
+ {
echo "<p>Nous sommes le ".date("Y-m-d H:i:s",$_COOKIE['date'])."</p>";
- }
+ }
+}
+else {
+ echo "Mauvais mot de passe";
+}
?>
</div>
</body>