You mean that the post method works although that I cannot see it?
My code is this
Code:
<?php require_once('../Connections/palso.php'); ?>
<?php
mysql_select_db($database_palso, $palso);
$query_Recordset1 = "SELECT * FROM accs";
$Recordset1 = mysql_query($query_Recordset1, $palso) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><?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['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "list.php";
$MM_redirectLoginFailed = "login_failed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_palso, $palso);
$LoginRS__query=sprintf("SELECT user, pass FROM accs WHERE user='%s' AND pass='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $palso) 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=windows-1253" />
<title>Untitled Document</title>
<link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="form">
<form action="<?php echo $loginFormAction; ?>" method="post" name="form_login" id="form_login">
<fieldset>
<legend>
Περιοχή μελών</legend>
<label>
Όνομα χρήστη<br />
<input name="user" type="text" id="username" value="<?php echo $_SESSION['user']; ?>" />
</label>
<br />
<label>
Κωδικός πρόσβασης<br />
<input name="pass" type="password" id="pass" />
</label>
<br />
<input name="Submit" type="submit" value="Είσοδος" />
</fieldset>
</form>
</div>
<p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Providing the correct username and psw it opens the form action page. I wonder, is the userdata passed to it?
How can I achieve user to stay logged in until the session expires?
Where do I go from here?
Thanks for your concern
Bookmarks