質問編集履歴

4

phpソースの変更

2019/02/26 09:35

投稿

kings_of_king12
kings_of_king12

スコア33

test CHANGED
File without changes
test CHANGED
@@ -92,6 +92,8 @@
92
92
 
93
93
  $data=json_decode($json);
94
94
 
95
+ file_put_contents("json.txt" , $data);
96
+
95
97
  echo $_POST[$data];
96
98
 
97
99
  ?>

3

php側のソースを変更

2019/02/26 09:35

投稿

kings_of_king12
kings_of_king12

スコア33

test CHANGED
File without changes
test CHANGED
@@ -88,15 +88,11 @@
88
88
 
89
89
  // //ajax送信でPOSTされたデータを受け取る
90
90
 
91
- $json=file_get_contents("post.html");
91
+ $json=file_get_contents("php://input");
92
-
93
- $json = mb_convert_encoding($json, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN');
94
92
 
95
93
  $data=json_decode($json);
96
94
 
97
- var_dump($data);
95
+ echo $_POST[$data];
98
-
99
- // file_put_contents("json.txt" , $data);
100
96
 
101
97
  ?>
102
98
 

2

ソースの言語を追記しました。

2019/02/26 09:32

投稿

kings_of_king12
kings_of_king12

スコア33

test CHANGED
File without changes
test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  <script type="text/javascript">
22
22
 
23
- ```
23
+ ```javascript
24
24
 
25
25
 
26
26
 
@@ -82,7 +82,7 @@
82
82
 
83
83
  【phpソース】
84
84
 
85
- ```
85
+ ```php
86
86
 
87
87
  <?php
88
88
 

1

ソースを見やすくするためにcodeタグを使いました。

2019/02/26 09:27

投稿

kings_of_king12
kings_of_king12

スコア33

test CHANGED
File without changes
test CHANGED
@@ -19,6 +19,8 @@
19
19
  【javascriptソース】
20
20
 
21
21
  <script type="text/javascript">
22
+
23
+ ```
22
24
 
23
25
 
24
26
 
@@ -72,11 +74,15 @@
72
74
 
73
75
  </script>
74
76
 
77
+ ```
78
+
75
79
 
76
80
 
77
81
 
78
82
 
79
83
  【phpソース】
84
+
85
+ ```
80
86
 
81
87
  <?php
82
88
 
@@ -93,3 +99,5 @@
93
99
  // file_put_contents("json.txt" , $data);
94
100
 
95
101
  ?>
102
+
103
+ ```