hi..i wrote this code for when i sign in, it sends another file the id and registers the session…heres the file where i check if the user is a member..
[code=php]
<?php
$sqluser=”select id from members_tbl where username='”.$user.”‘ and password='”.$pass.”‘”;
$resuser=mysql_query($sqluser);
$rowsuser=mysql_num_rows($resuser);
if($rowsuser>0)
{
$rows = mysql_fetch_array($resuser);
$id = $rows[0];
$_SESSION[‘authorized_user’]=true;
echo “<script>location.href(‘../index.php?member=$id’);</script>”;
}
?>
heres the second file where i check if the session is registered…and if it is, i print out the user’s first and last name..
<?php if(isset($_REQUEST[‘member’])){
session_save_path(“sessions”);
session_start();
if(session_is_registered(‘authorized_user’))
{
if($_SESSION[‘authorized_user’]==true)
{
$idd = $_REQUEST[‘member’];
$sqlUser = “select firstname,lastname from members_tbl where id ='”.$idd.”‘”;
$resUser = mysql_query($sqlUser);
$rowUser = mysql_fetch_array($resUser);
$first = $rowUser[0];
$last = $rowUser[1];
echo “<tr><td><center>Welcome $first $last!</td></tr></center>”;
}
}
}
?>
and finally, it does actually print out the name..but this error comes out as well:
Warning: session_start(): Cannot send session cookie – headers already sent by (output started at c:program fileseasyphp1-7wwwworkbaleishmenu.js:11) in c:program fileseasyphp1-7wwwworkbaleishindex.php on line 50
Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at c:program fileseasyphp1-7wwwworkbaleishmenu.js:11) in c:program fileseasyphp1-7wwwworkbaleishindex.php on line 50
any ideas?..