non funziona.....
Ecco tutto il codice:
Codice PHP:
<?php
if(!isset($_POST["pass"]))
header("Location: nonautorizzato.php");
$pass = htmlentities($pass);
/* Variabili precedenti */
$user=$_POST['user'];
$pass=$_POST['pass'];
/* Connessione e selezione del database */
$cn= mysql_connect("localhost", "xxx", "xxx")
or die("[b]Errore:[/b] Impossibile connettersi al Database mysql");
mysql_select_db("xxx",$cn)
or die("[b]Errore:[/b] Impossibile accedere al Database Mysql");
$query="SELECT * FROM utenti WHERE user='$user' AND pass='$pass' ";
$queryresult = mysql_query($query,$cn)
or die("[b]Errore:[/b] Usare il tasto Indietro del Browser per reinserire l'user e password'");
/* Controllo se si hanno le autorizzazioni necessarie */
if(mysql_num_rows($queryresult)<1)
header("Location: nonautorizzato.php");
session_start();
$_SESSION["autorizzato"] = true;
header("Location: 'index.htm');
?>