dpwu16132 2016-08-12 13:49
浏览 20

更改目录时,会话不起作用

Sessions does not work when I change directory. I mean my files that contain codes for sessions run on the main directory. However, when I upload same files to different directory, they does not run. The same codes, files but not working in different directory. What is the problem? I confused.

Here is my codes:

<?php
    ob_start();
session_start();

  include("db.php");

$rota=strip_tags($_POST["rota"]);

$date=strip_tags($_POST["date"]);

$_SESSION['rota']=$rota;
$_SESSION['date']=$date;

?>
------

<?php session_start();
ob_start();
  include("db.php");
$date=$_SESSION["date"];
$rota=$_SESSION["rota"];
echo "Date :    <b>".$date."<br><br></b>"; 

?>

And here is my error log:

[12-Aug-2016 13:51:41 UTC] PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /home/karelyac/public_html/reserve/en/y1s3.php:1) in /home/karelyac/public_html/reserve/en/y1s3.php on line 3
[12-Aug-2016 13:51:41 UTC] PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /home/karelyac/public_html/reserve/en/y1s3.php:1) in /home/karelyac/public_html/reserve/en/y1s3.php on line 3
[12-Aug-2016 13:51:41 UTC] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/karelyac/public_html/reserve/en/db.php on line 7
[12-Aug-2016 13:51:43 UTC] PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /home/karelyac/public_html/reserve/en/y1s2.php:1) in /home/karelyac/public_html/reserve/en/y1s2.php on line 3
[12-Aug-2016 13:51:43 UTC] PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /home/karelyac/public_html/reserve/en/y1s2.php:1) in /home/karelyac/public_html/reserve/en/y1s2.php on line 3
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端