tp4 ex1
This commit is contained in:
parent
045ec81ae2
commit
74ebab4b24
@@ -1,44 +1,50 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
|
||||
/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cookie OS préféré</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
|
||||
/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<form method="POST">
|
||||
<fieldset class="grid">
|
||||
<legend>Changez votre os</legend>
|
||||
<?php foreach ($osSet as $value => $label) { ?>
|
||||
<label>
|
||||
<input
|
||||
type="radio"
|
||||
name="os"
|
||||
value="<?php echo htmlspecialchars($value, ENT_QUOTES); ?>"
|
||||
<?php echo $os === $value ? 'checked' : ''; ?>
|
||||
>
|
||||
<i class="fa fa-<?php echo htmlspecialchars($value, ENT_QUOTES); ?> fa-2x" aria-hidden="true"></i>
|
||||
<?php echo htmlspecialchars($label, ENT_QUOTES); ?>
|
||||
</label>
|
||||
<?php } ?>
|
||||
</fieldset>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<form method="POST">
|
||||
<fieldset class="grid">
|
||||
<legend>Changez votre os</legend>
|
||||
<label>
|
||||
<input type="radio" name="os" value="linux">
|
||||
<i class="fa fa-linux fa-2x" aria-hidden="true"></i>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="os" value="windows">
|
||||
<i class="fa fa-windows fa-2x" aria-hidden="true"></i>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="os" value="apple">
|
||||
<i class="fa fa-apple fa-2x" aria-hidden="true"></i>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Envoyer</button>
|
||||
</form>
|
||||
<article>
|
||||
<header>Votre os</header>
|
||||
<?php echo "<i class='fa fa-$os fa-5x'></i>";?>
|
||||
<footer>
|
||||
Rafraîchir la page <a href=""><i class="fa fa-refresh" aria-hidden="true"></i></a>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
</body>
|
||||
<button type="submit">Envoyer</button>
|
||||
</form>
|
||||
<article>
|
||||
<header>Votre os</header>
|
||||
<p>
|
||||
<!-- On affiche l'icône et le nom de l'OS courant. -->
|
||||
<i class="fa fa-<?php echo htmlspecialchars($os, ENT_QUOTES); ?> fa-5x" aria-hidden="true"></i>
|
||||
</p>
|
||||
<p><?php echo htmlspecialchars($osSet[$os], ENT_QUOTES); ?></p>
|
||||
<footer>
|
||||
Rafraîchir la page
|
||||
<a href="./" aria-label="Rafraîchir la page">
|
||||
<i class="fa fa-refresh" aria-hidden="true"></i>
|
||||
</a>
|
||||
</footer>
|
||||
</article>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user