Codice PHP:
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$id=session_id();
$startS= session_start();
$NomeS = session_name(",$username,");
include ("condb.php");
$query= "SELECT * FROM utente WHERE User='$username' and Password='$password'";
$select=mysql_query($query) or die("Query fallita");
//x visualizzare spedito : echo "$username","
", "$password";
echo $id,"
",$startS,"
",$NomeS ;
if($username<>0 AND $password<>0) {
header("Location: registrazione.php");
}
else {
header("Location: default.php");
}
?>
Questa è tutta la pagina di Autenticazione dell'utente
Questa pagina (Autenticazione.php) riceve i dati da un form che si trova in una pagina chiamata LogIn con metodo POST
Anzi la pagina Login.php ve lo posto di seguito
Codice PHP:
<html>
<head>
<title>LogIn</title>
<link rel="stylesheet" type"text/css" media="screen" href="Style.css" />
</head>
<body>
<?php
include ("condb.php");
?>
<p class="Titoletto" align="center">LogIn</p>
<form name="login" method="post" action="autenticazione.php">
<table border="0" align=center>
<tr>
<td>Username:</td>
<td>
<input name="username" type="text" id="username">
</td>
</tr>
<tr>
<td>Password:</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td>
<input type="submit" name="Submit" value="Invia">
</td>
<td>
<input type="reset" name="Submit2" value="Cancella">
</td>
</tr>
</table>
</form>
</body>
</html>
Spero vi servano per trovare il problema..........