Session Variable In php

alex74

New Member
This simple issue I know, in my program session variable is already working properly but now it show some error. I am starting the session in my config page with \[code\]session_start(); ob_start();\[/code\] And then include this page in all pages. But if run the program I receive this error message:\[quote\] Cannot send session cache limiter - headers already sent\[/quote\]If remove the included config page the session variable is notworking.\[code\]session_start(); ob_start(); $dbcont = mysql_connect("localhost","root",""); mysql_select_db("emplist",$dbcont);if($_POST["subSubmit"]=="Submit") { $user = $_POST["txtUsername"]; $pass = $_POST["txtPassword"]; if ($user == "user" && $pass == "pass") { $_SESSION["uaid"] = "ADMIN SECTION"; header("Location:welcome.php"); exit(); }else{ $err = "Login Failed. Check You UserID/Password"; } }?><html> <head> <title>.:: Employee Management ::.</title></head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form1" id="form1" onSubmit="return checklogin();"> USER ID : <input type="text" name="txtUsername" id="txtUsername" onKeyUp="return clearerr();"> PASSWORD : <input type="password" name="txtPassword" id="txtPassword" onKeyUp="return clearerr();"> <input type="submit" class="FormButton" name="subSubmit" id="subSubmit" value="http://stackoverflow.com/questions/3792624/Submit"> &nbsp; <input type="reset" class="FormButton" name="butReset" id="butReset" value="http://stackoverflow.com/questions/3792624/Reset"> </form> </body></html>\[/code\]This is my main page code. If login is successful then the control will be moved to "Welcome.php" page in that page I just echo the session variable.
 
Back
Top