質問編集履歴
2
編集
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
PHPの出力で404エラー
|
body
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
PHPのコードで以下を実行するとこのファイルだけ404が出ます
|
2
2
|
|
3
|
+
ほかの.phpファイルと同じところに置いてあります
|
4
|
+
|
3
5
|
<?php
|
4
6
|
header("Content-type: text/html; charset=utf-8");
|
5
7
|
|
1
編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
PHPのコードで以下を実行するとこのファイルだけ404が出ます
|
2
2
|
|
3
|
+
<?php
|
3
4
|
header("Content-type: text/html; charset=utf-8");
|
4
5
|
|
5
6
|
if(empty($_POST)) {
|
@@ -39,4 +40,27 @@
|
|
39
40
|
print('Error:'.$e->getMessage());
|
40
41
|
$errors['error'] = "データベース接続失敗しました。";
|
41
42
|
}
|
42
|
-
}
|
43
|
+
}
|
44
|
+
|
45
|
+
?>
|
46
|
+
|
47
|
+
<!DOCTYPE html>
|
48
|
+
<html>
|
49
|
+
<head>
|
50
|
+
<title>登録画面</title>
|
51
|
+
<meta charset="utf-8">
|
52
|
+
</head>
|
53
|
+
<body>
|
54
|
+
|
55
|
+
<?php if (count($errors) === 0): ?>
|
56
|
+
<p><?=htmlspecialchars($yourname, ENT_QUOTES, 'UTF-8')."さんで登録いたしました。"?></p>
|
57
|
+
<?php elseif(count($errors) > 0): ?>
|
58
|
+
<?php
|
59
|
+
foreach($errors as $value){
|
60
|
+
echo "<p>".$value."</p>";
|
61
|
+
}
|
62
|
+
?>
|
63
|
+
<?php endif; ?>
|
64
|
+
|
65
|
+
</body>
|
66
|
+
</html>
|