I've a php script the first thing in the code is session_start();
, but I keep receiving this error
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/****/public_html/admincp/index.php:1) in /home/****/public_html/admincp/index.php on line 1
but the script works great in the localhost
.
<?php session_start();?>
<?php
require 'global.php';
?>
<?php
//check if the user logged in
if(!isset($_SESSION['user_id']))
page_redirect('login.php'); // go to login.php.
?>