le vie del signore sono infinite ... a volte mi perdo in un bicchier d'acqua 
infatti ho aggiunto questo come mi hai detto, ma sia che mi logo come admin level 2
sia che mi logo con searedone level 1
non vedo la parte tra l'ifa e endif
Codice PHP:
<?php
//connessione al database
include 'db_connect.php';
$result=$_SESSION['user_id'];
//inizio sessione per l'utente che ha effettuato il login
session_start();
if(isset($_SESSION['username'])&& isset($_SESSION['password']))
{
echo "Benvenuto " . $_SESSION['username'];
}else{
header("Location: login.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<head>
<title>prova</title>
<link rel="stylesheet" href="stile.css" type="text/css">
<link rel="shortcut" href="http://localhost/favicon.ico">
</head>
<body>
<div id="contenitore">
<?php
include 'db_connect.php';
$query = @mysql_query(
'SELECT *
FROM users WHERE id='.$_SESSION['user_id'].'');
if (!$query) {
exit('
Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($query)) {
$id = $row['id'];
$nome = $row['nome'];
$cognome = $row['cognome'];
$telefono = $row['telefono'];
$email = $row['email'];
$web_site = $row['web_site'];
$regione = $row['regione'];
$provincia = $row['provincia'];
$comune = $row['comune'];
$cap = $row['cap'];
$ts = $row['ts'];
// Display the joke with author information
echo "cod cliente: $id
";
echo "Nome: $nome
";
echo "Cognome: $cognome
";
echo "Telefono: $telefono
";
echo "Email: [email='$email']$email[/email]
";
echo "Website: <a href=http://$web_site>$web_site</a>
";
echo "Regione: $regione
";
echo "Provincia: $provincia
";
echo "Comune: $comune
";
echo "Cap: $cap
";
echo "Data di registrazione:$ts
";
}
?>
<?php echo $_SESSION['user_id'];?>
<?php echo $_SESSION['username'];?>
[url="logout.php"]Logout [/url]
<?php if($_SESSION['level'] > 1): ?>
[url="admin.php"]admin [/url]
<?php endif; ?>