-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathformConfirmation_sub.php
More file actions
54 lines (50 loc) · 1.36 KB
/
formConfirmation_sub.php
File metadata and controls
54 lines (50 loc) · 1.36 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
//セッションの開始
session_start();
// ニックネーム
$textName = $_SESSION["textName"];
// おすすめのカフェの名前
$textArea = $_SESSION["textArea"];
//おすすめのカフェのURL
$textGenre = $_SESSION["textGenre"];
// SNSを知らせるか選択
$textMessage = $_SESSION["textMessage"];
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./css/style.css">
<title>PHP基本トレーニング</title>
</head>
<body>
<h2>入力したデータ</h2>
<table>
<tr>
<th>テキスト</th>
<th>日付</th>
<th>項目</th>
</tr>
<?php
echo "<tr>";
echo "<td>" . $textName . "</td>";
echo "<td>" . $textArea . "</td>";
echo "<td>" . $textGenre . "</td>";
echo "<td>" . $textMessage . "</td>";
echo "</tr>";
?>
</table>
<button onclick="location.href='./dataRegist.php'">遷移</button>
</body>
</html>
<?php
// 入力データを出力後に、セッションを削除
unset($_SESSION["textName"]);
unset($_SESSION["textArea"]);
unset($_SESSION["textGenre"]);
unset($_SESSION["textMessage"]);
unset($_SESSION["errorName"]);
unset($_SESSION["errorArea"]);
unset($_SESSION["errorGenre"]);
unset($_SESSION["errorMessage"]);
?>