hi
thrr is no one who can help me this is the prog which when i run faces problem of session.
session_start(): Cannot send session cookie - headers already sent
pls plssssssssss help me to solve the problem below is the code
any one this is simple prog but i can't run
if i can't run thn my boss will kick me out of the office.
so pls hlp me.
<?session_start();?>
<?php
include"db_config.php";
$connect = mysql_connect("$db_host", "$db_user", "$db_password");
mysql_select_db("$db_name", $connect) or die(mysql_error());
$f_name= $_POST['fname'];
$l_name= $_POST['lname'];
$pass= $_POST['password'];
$query = "SELECT * from helpagent WHERE first='$f_name' and last='$l_name' and password='$pass' ";
$result = mysql_query($query);
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$id = mysql_result($result, $i, "agentid");
$fname = mysql_result($result, $i, "first");
$lname = mysql_result($result, $i, "last");
$pas = mysql_result($result, $i, "password");
if (("$f_name" == "$fname") and ("$l_name" == "$lname") and ("$pass" == "$pas"))
{
$_SESSION['sfname'] = $fname;
$_SESSION['slname'] = $lname;
$_SESSION['sid'] = $id;
echo("<script>document.location.href='user_page.php';</script>");
exit;
}//if loop
}//for loop
?>