Hi all,I'm an amateur to php.In my project with mysql as backend,I have a login form that requires the creation of a session having value as the authorised user.This will enable me to access the userid the following webpages.The code is as follows:
(the same page is submitted to check the login authorisation & create session...then move to BookingDetails.php)
Login.php
<?php
include("dbconnect.php");
?>
<?php
if ($POST['submit'])
{$login = $REQUEST['id'];
....checks whether login id is authorised.....
if(strcmp($row["Password"],$password) == 0)
{session_start();
session_register('uname');
$_SESSION['uname']=$login;
echo "<script language=\"JavaScript\">self.location=\"http://192.168.2.16/maharaja/BookingDetails.php\"</script>";
}
?>
BookingDetails.php
<?php
session_start();
$name=$_SESSION["uname"];
echo $name; #loginname-vinutha
?>
On the BookingDetails.php page...though the value of session 'uname' is displayed...I get the following warning:
Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/html/maharaja/BookingDetails.php:3) in /var/www/html/maharaja/BookingDetails.php on line 4
vinutha
Please help as to how to avoid the above warning.Note that this works perfectly well on another two pages that does not have any database interaction.Thanx in advance.