<?php
session_start();
if ($finame>=1){
echo "Prego effettuare il login <a href=\"/admin/index.php\"> Qui<br>
&copy;Bloghosteria.com<br>
</a>";
}
 elseif  ( empty( $finame ) ) {
?> Prego effettuare il login <a href="/admin/index.php"> Qui<br>
&copy;Bloghosteria.com<br>
</a>
<?php
} elseif ($finame==$_SESSION['finame']) { 
include ("config.php");
include ("headnavadmin.php");
echo "<style type=\"text/css\">
<!--
a:link, a:visited {
	color: #009933; text-decoration: none;
	font-weight: bold;
}

a:hover {
	color: #ff6600;	text-decoration: none;
	font-weight: bold;	
}

.style5 {
	color: #ff0000;
	font-size: 24px;
}
-->
</style>
<p class=style2>Salve, 
". $_SESSION['laname'] ."  <a href=logout.php> Logout</a></p>
<h1 class=style5>Gestisci Flash Template </h1>";
include ("config.php");
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase"); 

$query = "update flashtemp  set 
nome='$nome',agggr='$agggr' where 
nome='$nome'";
$result = mysql_db_query("$dbname", $query);
$query = "select * from flashtemp  "; 
$result = mysql_db_query("$dbname", $query);
if ($result) { 

 

while ($r = mysql_fetch_array($result)) { 
$nome = $r["nome"];

$agggr = $r["agggr"]; 

echo "Il  template scelto è $agggr"; 
} 
 
} else {
 
 $query = 'CREATE TABLE  IF NOT EXISTS flashtemp  ('
        . ' `nome` VARCHAR(30), '
        . ' `agggr` VARCHAR(30) '
        . ' )';   
 $result = mysql_db_query("$dbname", $query);
 
$query = "insert into flashtemp values ('$nome','$agggr')";
$result = mysql_db_query("$dbname", $query);

echo "Il tuo template è $agggr";
 
} 

} else {
echo "Prego effettuare il login <a href=\"/admin/index.php\"> Qui<br>
&copy;Bloghosteria.com<br>
</a>";
}

?>