-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
32 lines (27 loc) · 886 Bytes
/
insert.php
File metadata and controls
32 lines (27 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
mb_internal_encoding("UTF-8");
$pdo = new PDO("mysql:dbname=lesson01;host=localhost;","root","");
$sql = "insert into contactform(name,mail,age,comments) values(?,?,?,?)";
$stmt = $pdo->prepare($sql);
$stmt->bindValue(1, $_POST['name']);
$stmt->bindValue(2, $_POST['mail']);
$stmt->bindValue(3, $_POST['age']);
$stmt->bindValue(4, $_POST['comments']);
$stmt->execute();
?>
<!DOCTYPE html>
<html lang="js">
<head>
<meta charset="utf-8">
<title>お問い合わせフォームを作る</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>お問い合わせフォーム</h1>
<div class="confirm">
<p>
お問い合わせ有難うございました。<br>3営業以内に担当者よりご連絡差し上げます。
</p>
</div>
</body>
</html>