Skip to content

Commit 05bd389

Browse files
Merge branch 'main' of https://github.com/Viktoriia-code/Java_Script into main
2 parents d91cfa3 + 0cc936c commit 05bd389

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
2-
3-
$etu = $_POST["etunimi"];
4-
$suku = $_POST["sukunimi"];
5-
$os = $_POST["losoite"];
6-
$pnro = $_POST["pnro"];
7-
$ptp = $_POST["ptp"];
8-
$maa = $_POST["maa"];
2+
$firstName = $_POST["firstName"];
3+
$lastName = $_POST["lastName"];
4+
$address = $_POST["address"];
5+
$index = $_POST["index"];
6+
$city = $_POST["city"];
7+
$phone = $_POST["phone"];
8+
$email = $_POST["email"];
99

1010
$palvelin = "localhost";
1111
$kayttajatunnus = "root";
@@ -18,8 +18,5 @@
1818
echo "Failed to connect to MySQL: " . mysqli_connect_error();
1919
}
2020

21-
$vastaus = mysqli_query($yhteys, "INSERT INTO osoitteet VALUES ('$etu', '$suku', '$os', '$pnro', '$ptp', '$maa')");
22-
23-
24-
25-
?>
21+
$vastaus = mysqli_query($yhteys, "INSERT INTO osoitteet VALUES ('$firstName', '$lastName', '$address', '$index', '$city', '$phone', '$email')");
22+
?>

Ryhmätyöt/Project6-SQL-form/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<title></title>
66
<link rel="stylesheet" href="styles.css">
77
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap" rel="stylesheet">
8+
<script src="script.js" charset="utf-8"></script>
89
</head>
910
<body>
1011
<div class="container">
@@ -28,7 +29,7 @@ <h3>Contact me to start our next project!</h3>
2829
123-456-7890
2930
</div>
3031
</div>
31-
<form class="" action="data.php" method="post" onSubmit="return formValidation(this);" onReset="return formReset(this)">
32+
<form class="" action=data.php method=POST onSubmit="return formValidation(this);" onReset="return formClean(this)">
3233
<table id="form-inputs">
3334
<tr>
3435
<td><label for="first-name">First name</label></td>
@@ -60,7 +61,7 @@ <h3>Contact me to start our next project!</h3>
6061
</tr>
6162
</table>
6263
<div class="btn-wrapper">
63-
<button type="reset" name="reset" id="reset-btn" class="control-btn" value="reset">Reset</button>
64+
<button type="reset" name="reset" class="reset-btn">Reset</button>
6465
<button type="submit" name="submit" id="submit-btn" class="control-btn" value="submit">Send</button>
6566
</div>
6667
</form>
@@ -70,6 +71,5 @@ <h3>Contact me to start our next project!</h3>
7071
© Viktoriia Beloborodova | <a href="https://www.keuda.fi/" class="keuda-link">Keuda</a>, 2022
7172
</div>
7273
</div>
73-
<script src="script.js" charset="utf-8"></script>
7474
</body>
7575
</html>

Ryhmätyöt/Project6-SQL-form/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ button:active {
116116
#submit-btn:hover {
117117
background-color: #87C081;
118118
}
119-
#reset-btn {
119+
.reset-btn {
120120
background-color: #FFCCCA;
121121
border: 2px solid #D66966;
122122
border-radius: 15px;
123123
transition: all 500ms ease;
124124
}
125-
#reset-btn:hover {
125+
.reset-btn:hover {
126126
background-color: #D66966;
127127
}
128128
.btn-wrapper {

0 commit comments

Comments
 (0)