質問編集履歴

3

2019/11/27 03:28

投稿

nikuniku12
nikuniku12

スコア14

test CHANGED
File without changes
test CHANGED
@@ -1,82 +1,6 @@
1
1
  idをphpに送信しそのidと等しいデータを削除しjs側で表示させたいのですが、txtファイルから削除したにも関わらずデータがなぜかずっと表示されます。何故だかわかりませんか?
2
2
 
3
3
 
4
-
5
- ```javascript
6
-
7
- $(function(){
8
-
9
- $("#send").on('click',function(){
10
-
11
- var ary_data = {};
12
-
13
- ary_data.userid = $('input[name="id"]').val();
14
-
15
- send_data=JSON.stringify(ary_data);
16
-
17
- $.ajax({
18
-
19
- type:"DELETE",
20
-
21
- url:"send.php",
22
-
23
- contentType: "Content-Type: application/json; charset=UTF-8",
24
-
25
- dataType : "json",
26
-
27
- data:send_data,
28
-
29
- }).done(function(data){
30
-
31
- data.forEach(function(x){
32
-
33
- Object.entries(x).forEach(y=>{
34
-
35
- $("#res").append('キー:'+y[0]+' :値:' +y[1]+"<br/>");
36
-
37
- });
38
-
39
- });
40
-
41
- }).fail(function(XMLHttpRequest, textStatus, errorThrown){
42
-
43
- alert(errorThrown);
44
-
45
- });
46
-
47
- });
48
-
49
- });
50
-
51
-
52
-
53
- <table>
54
-
55
- <tr>
56
-
57
-
58
-
59
- <th>ID:</th>
60
-
61
- <th><input type="text" id="id" name="id" maxlength="100" value=""></th>
62
-
63
- <th><button id="send" type="button">send</button>
64
-
65
- </th>
66
-
67
- </tr>
68
-
69
- </table>
70
-
71
- </form>
72
-
73
- </section>
74
-
75
- <div id="res"></div>
76
-
77
-
78
-
79
- ```
80
4
 
81
5
 
82
6
 

2

2019/11/27 03:28

投稿

nikuniku12
nikuniku12

スコア14

test CHANGED
File without changes
test CHANGED
@@ -116,7 +116,7 @@
116
116
 
117
117
  }
118
118
 
119
- $fp = fopen("json12.txt", "w");
119
+ $fp = fopen("product.txt", "w");
120
120
 
121
121
  fwrite($fp, implode("\r", $newLines));
122
122
 
@@ -124,7 +124,7 @@
124
124
 
125
125
 
126
126
 
127
- $fp=fopen("json12.txt","r");
127
+ $fp=fopen("product.txt","r");
128
128
 
129
129
  while(($data=fgetcsv($fp,1024))!==false){
130
130
 

1

タグのついか

2019/11/27 02:51

投稿

nikuniku12
nikuniku12

スコア14

test CHANGED
File without changes
test CHANGED
File without changes