且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

.html url中的$ _GET问题

更新时间:2023-02-23 18:42:00

此处的问题是文件是 .html 而不是 .php ,因此不会由PHP解析.如果您希望PHP也可以在 .html 上运行,请将其添加到您的 .htaccess 文件中:

The issue here is that the file is .html instead of .php, so it will not be parsed by PHP. If you want PHP to also work on .html, add this like to your .htaccess file:

AddType application/x-httpd-php .html

但是,我不推荐这样做,因为它不是真正的标准.在大多数情况下,***将文件重命名为 .php .

I wouldn't recommend it, though, since it's not really standard. In most cases, you're better off just renaming the file to .php.