Use of php Include in html files

前端 未结 3 1087
感动是毒
感动是毒 2021-01-15 03:10

I\'m having some problems on my website using some php code.
My site is mainly using html and php. Instead of repeating lots of lines of script at the top of every page

3条回答
  •  佛祖请我去吃肉
    2021-01-15 03:57

    If you use inside an HTML file it won't work. Reason? If the file has a .html extension, the browser will not be expecting PHP, so it won't do anything. If you have any PHP code in any file, give that file a .php extension. (Unless you have a specific reason for not doing this...?)

提交回复
热议问题