1.
<?php
2.
require_once
(
"settings.ppp"
);
3.
require_once
(
"html-head.ppp"
);
4.
require_once
(
"html-view.ppp"
);
5.
?>
settings.ppp
01.
<?php
02.
// セッション
03.
session_cache_limiter(
'nocache'
);
04.
session_start();
05.
06.
// ブラウザに必要な情報
07.
header(
"Content-type: text/html; charset=utf-8"
);
08.
09.
?>
html-head.ppp
01.
<!DOCTYPE html>
02.
<
html
lang
=
"ja"
>
03.
<
head
>
04.
<
meta
content
=
"width=device-width initial-scale=1.0 minimum-scale=1.0 maximum-scale=1.0 user-scalable=no"
name
=
"viewport"
>
05.
<
meta
charset
=
"UTF-8"
>
06.
<
link
rel
=
"stylesheet"
href
=
"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.css"
>
07.
<
title
>タイトル</
title
>
08.
09.
<
style
>
10.
#main {
11.
padding: 20px;
12.
}
13.
14.
.left {
15.
display:inline-block;
16.
width: 80px;
17.
margin-bottom: 20px;
18.
}
19.
20.
.right {
21.
display:inline-block;
22.
}
23.
24.
</
style
>
25.
26.
<
script
>
27.
</
script
>
28.
29.
</
head
>
html-view.ppp
01.
<body>
02.
<div
class
=
"alert alert-primary"
>ページ内タイトル</div>
03.
04.
<div id=
"main"
>
05.
<form method=
"post"
>
06.
07.
<div>
08.
<div
class
=
"left"
>氏名</div>
09.
<div
class
=
"right"
>
10.
<input
11.
type=
"text"
12.
id=
"fld_name"
13.
name=
"fld_name"
14.
required>
15.
</div>
16.
</div>
17.
18.
<div>
19.
<div
class
=
"left"
>フリガナ</div>
20.
<div
class
=
"right"
>
21.
<input
22.
type=
"text"
23.
id=
"fld_kana"
24.
name=
"fld_kana"
25.
required>
26.
</div>
27.
</div>
28.
29.
<input
class
=
"btn btn-primary"
type=
"submit"
name=
"send"
value=
"送信"
>
30.
31.
</form>
32.
</div>
33.
34.
<?php
35.
36.
print
"<pre>"
;
37.
print_r(
$_POST
);
38.
print
"</pre>"
;
39.
40.
?>
41.
</body>
42.
</html>