localhost and web - session problem



I made a small website with user-management system, I use this code for
loig-in:
<?
session_start(); //start the session
$login=$_POST["login"]; // check an hidden input
if($login=="access")
{
$username=$_POST["username"];
$password=$_POST["password"];
include "functions.php";
include "config.php";
$q="select username,password,userid,userlevel,gender from user";
$data=connect_easy($host,$db,$user,$pass,$q);
for($i=0;$i<count($data);$i++)
{
if(($username==$data[$i][0])and($password==$data[$i][1]))
{
$_SESSION["username"]=$data[$i][0]; //add new session data
$_SESSION["passowrd"]=$data[$i][1];
$_SESSION["id"]=$data[$i][2];
$_SESSION["level"]=$data[$i][3];
$_SESSION["gender"]=$data[$i][4];
?>
<meta http-equiv="refresh" content="0;URL=home.php"> // go to home page
<?
exit();
}
}
?>
<meta http-equiv="refresh" content="0;URL=index.php"> // login failed
<?
}else{
?>
<meta http-equiv="refresh" content="0;URL=index.php"> // login failed
<?
}
?>
************
in every page of the rest of the website I use this structure :
********
<?
session_start();
if ($_SESSION["username"]) {
..
..
..
here is the page
..
..
..
}else{
echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
}
***************
On localhost it is working perfectly, but when I put it on my hosting,
the session is working for one page and then it fails as there is no
sesion data, what is the problem, any hint ??
Please!

.



Relevant Pages

  • Re: EXITING WEBSITES
    ... someone can explain to me how to exit one website without completely exiting ... I access the internet using Internet ... The only way for me to exit is to click ... pull up the next, but then, I sometimes end up with 10 minimized pages!! ...
    (microsoft.public.macintosh.general)
  • Re: Warning: session_start() [function.session-start]: Cannot send session cache limiter - h
    ... Someone tries to register on my website but forgets to fill some ... echo "Gebruikersnaam is een verplicht veld. ... exit(); // if the error checking has failed, ...
    (comp.lang.php)
  • Warning: session_start() [function.session-start]: Cannot send session cache limiter - heade
    ... Someone tries to register on my website but forgets to fill some ... The error control detects it and sends the user back to the ... echo "Gebruikersnaam is een verplicht veld. ... exit(); // if the error checking has failed, ...
    (comp.lang.php)
  • RE: I cant exit IE6
    ... I used adware 6 from another website, ... I can't exit any IE window! ... >refuses to close. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: EXITING WEBSITES
    ... There's no need to "exit" a web site. ... someone can explain to me how to exit one website without completely ... I access the internet using Internet ...
    (microsoft.public.macintosh.general)