18.09
This commit is contained in:
97
Pracownia/P58 - zaprojektuj własne trampki/index.php
Normal file
97
Pracownia/P58 - zaprojektuj własne trampki/index.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>P58 - zaprojektuj własne trampki</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Zadanie P58</h1>
|
||||
<h2>Autor: Jakub Grzegorczyk</h2>
|
||||
</header>
|
||||
<div class="box">
|
||||
<p>PHP pobieranie danych za pomocą formularza <br><br>Zapoznaj się z rozdziałem podręcznika. Opracuj własny formularz i skrypt pobierający dane. Do wykonania zadania użyj różne komponenty formularzy. Przykładowy wygląd formularza pokazany jest na załączonej grafice.</p>
|
||||
</div>
|
||||
<div class="box" id="formbox">
|
||||
<form id="form" method="post" action="index.php">
|
||||
<fieldset id="formdata">
|
||||
<legend>Podstawowe dane</legend>
|
||||
<ul>
|
||||
<li><label for="form-name">Imię i nazwisko: </label><input class="text" type="text" name="name" id="form-name"></li>
|
||||
<li><label for="form-email">E-mail: </label><input class="text" type="email" name="email" id="form-email"></li>
|
||||
<li><label for="form-tel">Telefon: </label><input class="text" type="text" name="telephone" id="form-tel"></li>
|
||||
<li><label for="form-story">Moje buty są takie stare...</label><br>
|
||||
<textarea name="story" id="form-story" cols="60" rows="4" maxlength="300" placeholder="Nie więcej niż 300 znaków"></textarea></li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<h1>Zaprojektuj własne trampki</h1>
|
||||
<fieldset>
|
||||
<legend>Własny projekt butów</legend>
|
||||
<fieldset id="field1">
|
||||
<legend>Kolor (wybierz jeden)</legend>
|
||||
<label><input type="radio" name="color" value="red">Czerwony</label> <br>
|
||||
<label><input type="radio" name="color" value="blue">Niebieski</label> <br>
|
||||
<label><input type="radio" name="color" value="black">Czarny</label> <br>
|
||||
<label><input type="radio" name="color" value="silver">Srebrny</label> <br>
|
||||
</fieldset>
|
||||
<fieldset id="field2">
|
||||
<legend>Opcje (możesz wybrać kilka)</legend>
|
||||
<input type="checkbox" id="check1" name="check1"> <label for="check1">Błyszczące sznurówki</label> <br>
|
||||
<input type="checkbox" id="check2" name="check1"> <label for="check2">Metalowe logo</label> <br>
|
||||
<input type="checkbox" id="check3" name="check1"> <label for="check3">Święcące podeszwy</label> <br>
|
||||
<input type="checkbox" id="check4" name="check1"> <label for="check4">Odtwarzanie MP3</label> <br>
|
||||
</fieldset>
|
||||
<fieldset id="field3">
|
||||
<legend>Rozmiar</legend>
|
||||
<p><label for="selectsize">Rozmiar zgodny ze standardowymi rozmiarami butów: </label><select name="size" id="selectsize" size="1">
|
||||
<option value="37">37</option>
|
||||
<option value="38">38</option>
|
||||
<option value="39">39</option>
|
||||
<option value="40">40</option>
|
||||
<option value="41">41</option>
|
||||
<option value="42">42</option>
|
||||
<option value="43">43</option>
|
||||
<option value="44">44</option>
|
||||
<option value="45">45</option>
|
||||
<option value="46">46</option>
|
||||
<option value="47">47</option>
|
||||
<option value="48">48</option>
|
||||
</select></p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
<button type="submit">Submits</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="box">
|
||||
<?php
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$sent = true;
|
||||
$name = htmlspecialchars($_POST['name']);
|
||||
$email = htmlspecialchars($_POST['email']);
|
||||
$telephone = htmlspecialchars($_POST['telephone']);
|
||||
$story = htmlspecialchars($_POST['story']);
|
||||
|
||||
$color = htmlspecialchars($_POST['color']);
|
||||
$check1 = htmlspecialchars($_POST['check1']);
|
||||
$size = htmlspecialchars($_POST['size']);
|
||||
|
||||
echo "<p>";
|
||||
echo "imie: $name \n";
|
||||
echo "email: $email \n";
|
||||
echo "telefon: $telephone \n";
|
||||
echo "buty: $story \n";
|
||||
echo "kolor: $color \n";
|
||||
echo "opcje: $check1 \n";
|
||||
echo "rozmiar: $size \n";
|
||||
echo "</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
68
Pracownia/P58 - zaprojektuj własne trampki/style.css
Normal file
68
Pracownia/P58 - zaprojektuj własne trampki/style.css
Normal file
@@ -0,0 +1,68 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: Verdana, serif;
|
||||
background: #ffffff;
|
||||
margin: 15px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
header {
|
||||
border: 2px solid black;
|
||||
border-radius: 1em;
|
||||
padding: 10px 20px;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
input {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
width: 30%;
|
||||
border: black 2px solid;
|
||||
border-radius: 0.5em;
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 5px;
|
||||
width: 30%;
|
||||
border: black 2px solid;
|
||||
border-radius: 0.5em;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
}
|
||||
pre {
|
||||
font-family: Verdana, serif;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 2px solid black;
|
||||
padding: 15px 20px;
|
||||
border-radius: 1em;
|
||||
margin: 15px 0 10px 0;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
|
||||
}
|
||||
|
||||
.box h3 {
|
||||
cursor: pointer;
|
||||
}
|
||||
td {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
tr {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.y {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
.b {
|
||||
background:blue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user