Whenever i run session in server than it show this problem
Warning: session_start(): Cannot send session cache limiter - headers already sent
so pls help me
this is simple login prog when user enter into nxt page it name will show i want to store its name in session
i m giving full code wht i m using if thr is anything wrong pls tell me :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad:
<? @session_start();?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0046)http://acmserver.cs.ucr.edu/~nkumar/vision.htm -->
<HTML>
<HEAD><TITLE>Bankon Us</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<link rel="stylesheet" href="style.css" type="text/css">
<body topmargin="0" leftmargin="0">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<TD align=center>
<table cellpadding="0" cellspacing="0" border=0 width="100%">
<tr><td height="25"> </td></tr>
<tr>
<td width="50%" align="right">
<?php
$_SESSION= $_POST;
$_SESSION= $_POST;
$_SESSION=$_POST;
if (($_SESSION == "peter") and ($_SESSION == "gewant") and ($_SESSION == "approvalagent"))
{
//header("Location:admin_page.php");
echo "<meta http-equiv='Refresh' content='0; url=admin_page.php'>";
exit;
}
$f_name= $_POST;
$l_name= $_POST;
$pass= $_POST;
if($_POST != "Login")
{
?>
<table border="0" cellpadding="5" cellspacing="3" width="80%" class="form-noindent">
<tr><td bgColor="#ff9900">
<form method="post" action="<?php $_SERVER?>">
<input type="hidden" name="agent" value="access">
<table border="0" width="100%">
<tr>
<td colspan="3" align="center" class="heading">Sign in with your<br> Account</td>
</tr>
<tr><td> </td></tr>
<tr>
<td> </td>
<td class="textform">First Name :</td>
<td class="forms" valign="top">
<input name="fname" class="cartForm" size=20 type="text"></td>
</tr>
<tr>
<td> </td>
<td class="textform">Last Name :</td>
<input name="lname" class="cartForm" size=10 type="hidden">
<td class="forms" valign="top">
<input name="lname" class="cartForm" size=20 type="text"></td>
</tr>
<tr>
<td> </td>
<td class="textform">Password :</td>
<td class="forms" valign="top">
<input class="cartForm" name="password" size=20 type="password"></td>
</tr>
<tr>
<td valign="top" colspan="3" align="center">
<input type="submit" name="submit" value="Login" class="cartForm" >
</td>
</tr>
<tr><td colspan="3"> </td></tr>
<tr>
<td colspan="2" align="center"><div class="leo"><a href="forget.php">Forget Password</a></div></td>
<td align="center"><div class="leo"><a href="order.php">New user click here</a></div></td>
</tr>
</table>
</form>
</td></tr>
</table>
</td>
<td width="50%" align="center"><img src="images/online.jpg"></td>
</tr>
</table>
<br><br>
<?php }
elseif($f_name== "" or $l_name== "" or $pass== "")
{
?>
<table border="0" cellpadding="5" cellspacing="3" width="80%" class="form-noindent">
<tr><td bgcolor="#00CC99">
<form method="post" action="<?php $_SERVER ?>">
<input type="hidden" name="agent" value="access">
<table border="0" width="100%">
<tr>
<td colspan="3" align="center" class="heading">Sign in with your Account</td>
</tr>
<tr><td> </td></tr>
<tr><td colspan="3" align="center" class="heading">Please fill all the fields</td></tr>
<tr><td> </td></tr>
<tr>
<td> </td>
<td class="textform">First Name :</td>
<td class="forms" valign="top">
<input name="fname" class="cartForm" size=20 type="text"></td>
</tr>
<tr>
<td> </td>
<td class="textform">Last Name :</td>
<input name="lname" class="cartForm" size=10 type="hidden">
<td class="forms" valign="top">
<input name="lname" class="cartForm" size=20 type="text"></td>
</tr>
<tr>
<td> </td>
<td class="textform">Password :</td>
<td class="forms" valign="top">
<input class="cartForm" name="password" size=20 type="password"></td>
</tr>
<tr>
<td valign="top" colspan="3" align="center">
<input type="submit" name="submit" value="Login" class="cartForm" >
</td>
</tr>
<tr><td colspan="3"> </td></tr>
<tr>
<td colspan="2" align="center"><div class="leo"><a href="forget.php">Forget Password</a></div></td>
<td align="center"><div class="leo"><a href="order.php">New user click here</a></div></td>
</tr>
</table>
</form>
</td></tr>
</table>
</td>
<td width="50%" align="center"><img src="images/login1.jpg" width="300" height="200"></td>
</tr>
</table>
<?php
}
else {
$query = "SELECT * from users WHERE firstname='$f_name' and lastname='$l_name' and password='$pass' ";
$result = mysql_query($query);
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$id = mysql_result($result, $i, "id");
$fname = mysql_result($result, $i, "firstname");
$lname = mysql_result($result, $i, "lastname");
$pas = mysql_result($result, $i, "password");
if (("$f_name" == "$fname") and ("$l_name" == "$lname") and ("$pass" == "$pas"))
{
$_SESSION = $f_name;
$_SESSION = $l_name;
echo "<meta http-equiv='Refresh' content='0; url=user_page.php'>";
exit;
}//if loop
}//for loop
echo "<meta http-equiv='Refresh' content='0; url=new_user.php'>";
//header("Location:new_user.php");
exit;
}
?>
</td>
</tr>
</table>
</BODY>
</HTML>