I have a problem with Session_start () here:
Warning : session_start () [function.session-start]: cannot send session cache limiter - headers already sent (output starts from C: \ xampp \ htdocs \ pages \ home.php: 4) to C: \ xampp \ htdocs \ charts \ home-chart.php on line 2
and in home-chart.php in line 2 I wrote these codes:
session_start(); . . . echo ' username: '.$_SESSION['user_name'];
although with this warning I can get the result of $_SESSION['user_name'] , but when I try to clear this part of the code:
session_start();
I do not see the result on the screen. so what's your solution?
<?php @session_start(); require_once '../class/chart.class.php'; $chart = new chart(); ?> <html> <head> <link href='../css/home-chart.css' rel='stylesheet' type='text/css' /> </head> <body> <div class='float_left' style="margin-bottom:20px;"> <div class='float_left' style='line-height: 9.41px; font-size: x-small;'>0<br /></div> <div class='float_left' style="background-image: url('../image/web/chart.png'); width: 367px; height: 226px; " > <div class='float_left float_left column' style='margin-left:2px;'> <?php echo $chart->mysql_fetch($chart->daycal(-3)); ?> </div> <div class='float_left float_left column'> <?php echo $chart->mysql_fetch($chart->daycal(-2)); ?> </div> <div class='float_left column' > <?php echo $chart->mysql_fetch($chart->daycal(-1)); ?> </div> <div class='float_left column' > <?php echo $chart->mysql_fetch($chart->daycal(0)); ?> </div> <div class='float_left column' > <?php echo $chart->mysql_fetch($chart->daycal(1)); ?> </div> <div class='float_left column' > <?php echo $chart->mysql_fetch($chart->daycal(2)); ?> </div> <div class='float_left column' > <?php echo $chart->mysql_fetch($chart->daycal(3)); ?> </div> </div> <div class='float_single_full' ></div> <div class='float_left bottom_chart' style="margin-left:10px;"><?php echo $chart->dayofweek(-3); ?></div> <div class='float_left bottom_chart'><?php echo $chart->dayofweek(-2); ?></div> <div class='float_left bottom_chart'><?php echo $chart->dayofweek(-1); ?></div> <div class='float_left bottom_chart' style='font-weight:bold'><?php echo $chart->dayofweek(0); ?></div> <div class='float_left bottom_chart'><?php echo $chart->dayofweek(1); ?></div> <div class='float_left bottom_chart'><?php echo $chart->dayofweek(2); ?></div> <div class='float_left bottom_chart'><?php echo $chart->dayofweek(3); echo ' username: ' . $_SESSION['user_name']; ?></div> </div> </body> </html>
source share