回答編集履歴
4
追記
test
CHANGED
@@ -43,3 +43,31 @@
|
|
43
43
|
```
|
44
44
|
|
45
45
|
かな。未検証です。typo あったらすみません。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
```lang-PHP
|
50
|
+
|
51
|
+
if(!$bbs['name'])
|
52
|
+
|
53
|
+
{
|
54
|
+
|
55
|
+
$name = '名無しさん';
|
56
|
+
|
57
|
+
echo $name;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
else
|
62
|
+
|
63
|
+
{
|
64
|
+
|
65
|
+
echo htmlspecialchars($bbs['name']);
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
がやりたいことかな?
|
72
|
+
|
73
|
+
foreach($bbs as $bbs) は foreach($bbs as $comment) の方が良いと思いますよ…
|
3
typo
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
$name = $_SESSION['name'];
|
14
14
|
|
15
|
-
$sql = "INSERT INTO onebord(name,message) VALUES ('" . $
|
15
|
+
$sql = "INSERT INTO onebord(name,message) VALUES ('" . $name . "','" . $_SESSION['message']."')";
|
16
16
|
|
17
17
|
```
|
18
18
|
|
2
typo
test
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
$timestamp = strtotime($str);
|
40
40
|
|
41
|
-
$str_formatted = date('Y/m/d H:
|
41
|
+
$str_formatted = date('Y/m/d H:i:s', $timestamp);
|
42
42
|
|
43
43
|
```
|
44
44
|
|
1
PHP の date は % 不要
test
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
$timestamp = strtotime($str);
|
40
40
|
|
41
|
-
$str_formatted = date('
|
41
|
+
$str_formatted = date('Y/m/d H:M:s', $timestamp);
|
42
42
|
|
43
43
|
```
|
44
44
|
|