douluchuo0801 2014-03-16 01:53
浏览 34
已采纳

实现PHP / Mysql登录系统到Wordpress网站

My friend has a wordpress site and wants me to add my premade PHP/Mysql login system. Currently i'm trying to insert PHP pages into the wordpress templates using this plugin: http://www.willmaster.com/software/WPplugins/.

The plugin lets me add php code to the page using this syntax:

[insert_php] include "account/login.php"; [/insert_php]

However, doing this creates an issues with sessions as the page header is already sent by the wordpress page before the php file is included. I'm getting the following error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at ...) Warning: Cannot modify header information – headers already sent by (output started at...

Any ideas how to fix this?

  • 写回答

2条回答 默认 最新

  • douhuangzhi0707 2014-03-16 03:45
    关注

    You can write the code for your login at the top in the theme's header.php or simply don't have session_start() in login.php. Or use session_status() to check if the session has started.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 STK matlab python仿真
  • ¥15 关于IMageEnView 图标定位问题
  • ¥20 求解答(matlab)
  • ¥30 ffmpeg库使用过程中遇到的问题
  • ¥15 pyqt5 中python如何通过Qtwebchannel主动发消息给web前端
  • ¥15 关于HTML中title获取xml内容的问题
  • ¥15 fanuc机器人PRIO083数字信号未复原错误,如何解决?
  • ¥20 如何为现有电路板增加远程控制功能
  • ¥15 UE5打包失败,求解决
  • ¥15 请问STM32G431的CANOPEN协议函数怎么写