質問編集履歴

2

誤字の修正

2019/07/19 15:40

投稿

okina
okina

スコア471

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  ajaxで別ドメインのphpにデータをpostしようと思っています。
2
2
 
3
- 今使っているサーバがCGI非対応なので、phpファイルだけ別のサーバに置こうと思っていますが、phpをサーバがSSL非対応のため、
3
+ 今使っているサーバがCGI非対応なので、phpファイルだけ別のサーバに置こうと思っていますが、phpを置くサーバがSSL非対応のため、
4
4
 
5
5
 
6
6
 

1

詳細の追加

2019/07/19 15:40

投稿

okina
okina

スコア471

test CHANGED
File without changes
test CHANGED
@@ -4,14 +4,48 @@
4
4
 
5
5
 
6
6
 
7
- Mixed Content: The page at 'https://example.com/1/' was loaded over
7
+ Mixed Content: The page at 'https://XXX/index.html' was loaded over HTTPS,
8
8
 
9
- HTTPS, but requested an insecure favicon 'https://example.com/2/'.
9
+ but requested an insecure script 'http:/XYZ/example.php'.
10
10
 
11
11
  This request has been blocked; the content must be served over HTTPS.
12
+
13
+
12
14
 
13
15
 
14
16
 
15
17
  とエラーが出ます。
16
18
 
17
19
  何か対策はありますでしょうか?
20
+
21
+
22
+
23
+ ```jquery
24
+
25
+ $.ajax({
26
+
27
+ type: 'POST',
28
+
29
+ url: 'http:/XYZ/example.php',
30
+
31
+ data: {name:value},
32
+
33
+ }).done(function(){
34
+
35
+ console.log("OK");
36
+
37
+ }).fail(function(){
38
+
39
+ console.log("ng");
40
+
41
+ });
42
+
43
+ ```
44
+
45
+
46
+
47
+ ```PHP
48
+
49
+ $name = $$_POST['name'];
50
+
51
+ ```