teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

質問文言修正

2021/05/25 22:37

投稿

wwwwwww
wwwwwww

スコア4

title CHANGED
File without changes
body CHANGED
@@ -1,44 +1,7 @@
1
- 今回以下のようなhtmlに書かれている、php include部分が上手く読み込めず、解決方法がわからないため教えていただけると助かります
1
+ htmlに書かれている、php include部分が上手く読み込めず、解決方法がわからないため教えていただけると助かります
2
2
 
3
3
 
4
- ```index.html
5
- <!DOCTYPE html>
6
- <html lang="ja">
7
- <head>
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
10
- <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
11
-
12
- <meta name="description" content="コンテンツ description">
13
- <meta name="keywords" content="keywords">
14
- <meta property="og:title" content="">
15
- <meta property="og:type" content="website">
16
- <meta property="og:url" content="">
17
- <meta property="og:image" content="">
18
- <meta property="og:site_name" content="">
19
- <meta property="og:description" content="" />
20
- <title>hogehoge</title>
21
-
22
- <?php include("https://www.hogehoge.jp/hogehoge.html"); ?>
23
- </head>
24
- <body>
25
-
26
- <?php include("https://www.hogehoge.jp/hoge-sp.html"); ?>
27
- <?php include("https://www.hogehoge.jp/hoge.html"); ?>
28
-
29
- <!-- [[ contents ]] -->
30
-
31
-
32
- <!-- [[ /contents ]] -->
33
-
34
- <?php include("https://www.hogehoge.jp/fuga-sp.html"); ?>
35
- <?php include("https://www.hogehoge.jp/fuga.html"); ?>
36
-
37
- </body>
38
- </html>
39
- ```
40
-
41
- サーバーはxserverを利用しており、php.iniの設定でallow_url_includeはonにしてます
4
+ サーバーはphp.iniの設定でallow_url_includeはonにしてます
42
5
  また、該当フォルダ内のhtaccessも
43
6
 
44
7
  https://xn--web-oi9du9bc8tgu2a.com/how-to-use-php-in-html-files/

1

誤字脱字

2021/05/25 22:37

投稿

wwwwwww
wwwwwww

スコア4

title CHANGED
File without changes
body CHANGED
@@ -53,5 +53,5 @@
53
53
  AddType application/x-httpd-php .php .htmlAddHandler application/x-httpd-php .php .html
54
54
  ```
55
55
 
56
- を記述しましたが、該当ドメインに接続してもなぜかindex.htmlやincludeの対象の絶対パスを表示するどころか、index.htmlをダウンロードしてしまいます
56
+ を記述しましたが、こちらhtaccessの変更より、接続してもindex.htmlやincludeの対象の絶対パスを表示するどころか、index.htmlをダウンロードしてしまう状況となり解決方法が見だせない状況となっています
57
57
  恐縮ながら、当方がphpやサーバーなどに疎く、根本的な部分で間違っているとは思うのですがお知恵を拝借できると幸いです