Notes
Notes - notes.io |
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="baner"><h1>ZSEII</h1></div>
<div id="lewo">
<form action="formularz.php" method="post">
<table>
<tr>
<td>
Imię: <input type="text" name="imie"/><input type="submit" value="Wyślij"/><br>
</td>
</tr>
<tr>
<td></td><td><input type="radio" name="plec" value="K"/>Kobieta</td>
</tr>
<tr>
<td>Płeć: </td>
</tr>
<tr>
<td></td><td><input type="radio" name="plec" value="M"/>Mężczyzna</td>
</tr>
<tr>
<td>
Wykształcenie:
<select name="wyksztalcenie">
<option>Podstawowe</option>
<option>Srednie</option>
<option>Wyzsze</option>
</select>
</tr>
</td>
<tr>
<td></td><td><input type="checkbox" value="Sport" name="zainteresowanie[]">Sport</td>
</tr>
<tr>
<td></td><td><input type="checkbox" value="Muzyka" name="zainteresowanie[]">Muzyka</td>
</tr>
<tr>
<td>Zainteresowanie:</td>
</tr>
<tr>
<td></td><td><input type="checkbox" value="Taniec" name="zainteresowanie[]">Taniec</td>
</tr>
<tr>
<td></td><td><input type="checkbox" value="Przyroda" name="zainteresowanie[]">Przyroda</td>
</tr>
</table>
</form>
</div>
<div id="prawo">
<?php
error_reporting(0);
if(!empty($_POST["imie"]))$imie=$_POST["imie"];
if(!empty($_POST["zainteresowanie"]))$zainteresowanie=$_POST["zainteresowanie"];
$zaint = $zainteresowanie[0] . " " . $zainteresowanie[1] . " " . $zainteresowanie[2] . " " . $zainteresowanie[3];
if(!empty($_POST["plec"]))$plec=$_POST["plec"];
{
$k=0;
$m=0;
}
if(!empty($_POST["wyksztalcenie"]))$wyksztalcenie=$_POST["wyksztalcenie"];
$con = mysqli_connect("localhost", "root", "", "4i1");
if (!$con) {
echo "MySQL database connection failed: " . mysqli_connect_error();
}
if(!empty($_POST["imie"])&&!empty($_POST["wyksztalcenie"])&&!empty($_POST["zainteresowanie"])&&!empty($_POST["plec"]))
{
$results = mysqli_query($con,"INSERT INTO dane (id, imie, plec, wyksztalcenie, zainteresowanie) VALUES ('', '$imie', '$plec', '$wyksztalcenie', '$zaint')");
}
$results = mysqli_query($con,"SELECT * FROM dane");
if ($results){
echo "<table><tr><td>ID</td><td>Imię</td><td>Płeć</td><td>Wykształcenie</td><td>Zainteresowanie</td></tr>";
while ($row = mysqli_fetch_assoc($results)){
echo "<tr><td>".$row["id"]."</td><td>".$row["imie"]."</td><td>".$row["plec"]."</td><td>".$row["wyksztalcenie"]."</td><td>".$row["zainteresowanie"]."</td></tr>";
if($row["plec"]=="K")
$k++;
else
$m++;
}
echo "</table>";
}
echo "Liczba kobiet: " . $k . "<br/> Liczba mężczyzn: " . $m;
mysqli_close($con);
?>
</div>
</body>
</html>
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team