当前位置: 动力学知识库 > 问答 > 编程问答 >

Can clients find php code inside html files?

问题描述:

I know they can't if it's a .php file but if it is in tags inside a .html file?

I couldn't find any info on this on google so I had to ask here.

网友答案:

As people have stated in the comments they cannot see your code as long as the server is configured correctly.

However, many web servers will eventually have their configuration files edited which from time to time will cause an error that would leave your code visible until fixed. If you have somewhat sensitive material in your PHP code (such as an API key) then you might consider issues such as the following:

  • Store sensitive code in an area that your web server won't provide direct access to.
  • Use an appropriate include method to get access to sensitive code without putting it directly into a web page.
分享给朋友:
您可能感兴趣的文章:
随机阅读: