【发布时间】:2012-04-07 16:30:58
【问题描述】:
我目前正在使用 PHP 和 jQuery 开发游戏,有时我需要使用 jQuery 中的 .load() 将 PHP 页面加载到 div 中。该页面将根据他们的登录信息、帐户 ID 等加载一些玩家信息,这些信息存储在 $_SESSION["arrayname"] 内部的一个数组中。
它在所有网站上都能完美运行,除了那些使用 jQuery load() 的网站。在easyphp上,我没有收到任何错误,但在我的网络主机服务器上我得到了这个:
警告:session_start() [function.session-start]:无法发送会话缓存限制器 - 在线 fr/game/map.php 中的标头已发送(输出开始于 /fr/game/map.php:1) 6
这是我的代码:
<?php
require_once("../../connectionRO.inc.php");
//used to check if we see the array in session, and i dont when i load it with jquery
if(!ISSET($_SESSION["comptejeu"]))
{
require_once('../../classInfoCompte.php');
session_start();
require_once('../../lg.php');
require_once("./glg.php");
}
$ic = new infoCompte;
$ic = $_SESSION["comptejeu"];
?>
我知道在这一点上,很多东西在加载之前已经输出到页面。谁能指出一种更好的方法来从该数组中检索我需要的信息以从我的类中构建我的对象?
谢谢。
【问题讨论】: