Salve ho creato una connessione al db, ma inserendo nome utente e password non si collega alla pagina relativa;nella pagina di login utente ho inserito questo codice:
<?php require_once('Connections/user.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['login utente'])) {
$loginUsername=$_POST['login utente'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "inserimento.php";
$MM_redirectLoginFailed = "errore.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_user, $user);
$LoginRS__query=sprintf("SELECT login utente, password FROM user WHERE login utente='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $user) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
</head>
<body>
<form ACTION="<?php echo $loginFormAction; ?>" id="form1" name="form1" method="POST">
<table width="50%" border="0" cellspacing="3" cellpadding="3" bgcolor="#CCCCCC">
<tr>
<td>Nome Utente</td>
<td><label>
<input name="login utente" type="text" id="login utente" maxlength="50" />
</label></td>
</tr>
<tr>
<td>password</td>
<td><label>
<input name="password" type="password" id="password" maxlength="50" />
</label></td>
</tr>
<tr>
<td></td>
<td><label>
<input type="submit" name="Submit" value="login" />
</label></td>
</tr>
</table>
</form>
</body>
</html>
ma non si collega a nessuna pagina... tutto questo è stato creato con dreamweaver, come posso fare?devo creare una pagina di login utente con password.grazie.ma che cosa ho sbagliato.