1) quali informazioni possono essere utili a capire il problema?
indxe.php:
Codice PHP:
<?php
session_start();
include_once('conn.inc.php');
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<html>
<head>
<title>Modulo gestione velivoli</title>
<link href="stile.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
if(!isset($_SESSION['loggato']) || $_SESSION['loggato'] != true){
echo "<center><h1>Modulo gestione velivoli Rotorjet</h1><form name='login' method='POST' action='login.php'>Username: <input type='text' name='un'> Password: <input type='password' name='pwd'> <input type='submit' name='sub' value='Entra'></form>";
}
if(isset($_SESSION['loggato']) || $_SESSION['loggato'] == true){
include('testa.php');
echo "
Login effettuato con successo. Sei nell'area privata del sito Rotorjet, lavora con criterio e cautela.
Evita di toccare
se non sai cosa stai facendo.";
}
?>
</center>
</body>
</html>
login.php
Codice PHP:
<?php
session_start();
include_once('conn.inc.php');
$un = stripslashes($_POST['un']);
$pd = stripslashes(md5($_POST['pwd']));
$q = mysql_query("SELECT * FROM utenti WHERE username='$un' AND password='$pd'");
$row = mysql_fetch_array($q);
if(mysql_num_rows($q) > 0){
$_SESSION['loggato'] = true;
$_SESSION['nome'] = $row['nome']." ".$row['cognome'];
$_SESSION['status'] = $row['profilo'];
//echo"[url='index.php']Loggato con successo, vai a lavorare![/url]";
header('Location: index.php');
}
else{
echo "Nome utente o password errati. [url='javascript:history.back();']Indietro[/url] ";
}
?>
ma lo stesso problema ce l'ho anche se al posto degli header torno indietro con un normale link...
problemi che peraltro NON ho mai avuto fino ad oggi