質問編集履歴
1
insert\.phpを追加しまして、1ページから2ページになりました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,18 +2,25 @@
|
|
2
2
|
接続はできましたが、書いた内容をdbに表示させるにはどうしたらいいですか?
|
3
3
|
もし参考ページなどございましたら、頂けたら幸いです。
|
4
4
|
よろしくお願いいたします。
|
5
|
-
|
5
|
+
------------------------------
|
6
|
+
調べたところ2ページ必要みたいで、少しコードを直します。
|
7
|
+
------------------------------
|
8
|
+
db.php
|
9
|
+
-----------------------------
|
6
10
|
```php
|
7
11
|
<html>
|
8
12
|
<head><title>PHP TEST</title></head>
|
9
13
|
<body>
|
10
|
-
<form method="post" name="form"
|
14
|
+
<form method="post" name="form" action="insert.php">
|
11
|
-
<input
|
15
|
+
<input type="text" name="name"></input>
|
12
16
|
<button type="submit">書き込み</button>
|
13
17
|
</form>
|
14
18
|
</body>
|
15
19
|
</html>
|
16
|
-
|
20
|
+
```
|
21
|
+
insert.php
|
22
|
+
----------------------
|
23
|
+
```php
|
17
24
|
<?php
|
18
25
|
|
19
26
|
$link = mysql_connect('localhost', 'root', '');
|
@@ -39,4 +46,5 @@
|
|
39
46
|
}
|
40
47
|
|
41
48
|
?>
|
49
|
+
|
42
50
|
```
|