.html文件中缺少PHP会话 [英] Missing PHP Session in .html file

查看:141
本文介绍了.html文件中缺少PHP会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将网上商店迁移到新的网络服务器。它在旧的Web服务器上运行得非常好,但是,当我尝试登录Webshop(index.html)时,它返回到主页,因为Session Variable为空而未登录。
然后我注意到,当我打开另一个名为request.php的站点时)会话变量已设置,并且我已登录。
所以我尝试了几件事,我将index.html重命名为index.php,然后会议在那里。



现在我的问题是:我是否也可以在.html文件中获得会话(就像以前的Web服务器一样)还是必须重命名所有.html文件?注意:index.html文件也包含php代码,并被解析为php,只是会话变量为空。



预先感谢每一个答案!

解决方案

如果您使用的是Apache服务器,请尝试将其添加到

  AddType应用程序/ x-httpd-php .html 


I'm trying to migrate a Webshop to a new Webserver. It is working perfectly fine on the old Webserver, however, when I try to login at the Webshop (index.html) it returns to the homepage, not logged in as the Session Variable is empty. Then I noticed, when I opened another Site called request.php) the Session Variable was set and I was logged in. So I tried several things, I renamed the index.html to index.php and the session was there.

My question is now: Can I get the Session in .html files, too (as on the previous Webserver) or do I have to rename all my .html files?

Note: The index.html file contains php code as well and is parsed as php, just the session variable is empty.

Thanks in advance for every answer!

解决方案

if you are using a Apache Server, try add this to the config file.

AddType application/x-httpd-php .html

这篇关于.html文件中缺少PHP会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆