ok, my code is really long by now, i try to send enough to understand it:
I start in with the file /view/index.php
this file includes a file that connects to the db (conf.inc.php) and my html template (standard.tpl)
in standard.tpl i call <?session_start();?>
standard.tpl also includes 2 files that get the information for the menus out of the db.
the next thing that it includes is a content.inc.php this file if build up like that
if($entry==1) /entry is set one when a user loggs in
{session_register("u_name")} together with that a button is displayed that sends me to view/index.php?level=2.2
each menu item in my db has a 'level' this is how i build up my menus.
now since $entry is not 1 anymore the next part of content.inc.php should be entered. this is the part that has all include files for a logged-in user.
If a user clicks on the logout button level is set to 0 and the user should be send to index.php?level=0&logout=1
in this file i ask
if($logout==1){
session_unregister("u_name");
echo"i just unregistered";
}
What happes is, i sign in it tells me that i logged in as firstname lastname, i click on the continue button and i am not logged in any more.... no idea why....
i just uploaded a very very very first version with all the errors..... i though that it might be a local error... it is not. maybe you could look at it.
you find it under www.e-horse.searchweb.biz
here also a extract of the files:
index.php
<?
#ruft alle nötigen Dateien auf damit Seite dargestellt werden kann
include("../config/format.inc.php");
include("../config/conf.inc.php");
include("../templates/standard.tpl");
?>
standard.tpl
<?
session_start();
?>
much HTML than
<?
ínclude("../templates/content.inc.php");
?>
than again much HTML
content.inc.php
<?
#is entered if user pressed sign-in button in sign in menu
if($entry == 1)
{ session_unset();
$LItem = &$conn -> Execute("SELECT email, first, last FROM $User WHERE email = '$email' AND pswd = '$pswd'");
if(!$LItem->EOF){ $content_ID=$LItem->fields;
$LItem->MoveNext();
$enrolled = 1;
$u_name = $email;
session_register("u_name");
$first = $content_ID[1];
$last = $content_ID[2];
$continue = "<br><form name=\"link\" method=\"post\" action=\"../view/index.php?level=2.1\" onSubmit=\"return valid(this)\">
<input type=\"submit\" name=\"continue\" value=\"Continue\">";
echo"<table border=\"0\" align=\"center\">
<tr><td>You Sign In as $first $last </td></tr>
<tr><td> Please click on the button below to
continue. $Textend </td></tr>
<tr><td>$continue</td></tr>
</table>";
}
}
#if user does not come from the sign in page
else
{ #creates content of the web page when user is signed in
if(!empty($u_name))
{ #get first and last name from user with enrolled email
$UItem = &$conn -> Execute("SELECT first, last FROM $User WHERE email = '$u_name'");
while(!$UItem->EOF)
{ $user_ID=$UItem->fields;
$UItem->MoveNext();
$first = $user_ID[0];
$last = $user_ID[1];
}
#chooses the content of the file depending on the level,
if ($level == 7){include("../templates/link.inc.php");}
.... and all the other levels that i have
to unregstered
if ($level == 0)
{$logout=1;
include("../templates/home.inc.php");
}
} #after this i have the same thing fornot registered users..... but too long to display here. the paramthesis might be mixed up in what i justed pasted.. but they are not in the real code
}
?>
the $level=0 file looks like that....
<?
if($logout==1)
{
session_unregister("u_name");
}
?>
<table border="0" width='75%'>
</table>
in another forum i read the post of a guy who had exactly the same problem... they didn't find an answer... one person said that javascript is sometimes the proplem... could that be what it is?
I really appreciate your help!!!!