<?php require_once('../../Connections/verbindung.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?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['strEmail'])) {
$loginUsername=$_POST['strEmail'];
$password=$_POST['strPassword'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "http://localhost/fffk/Templates/nacheinloggen/erfolg.php"; /*HIER STEHT DIE WEITERLEITUNG, BEI ONLINESTELLUNG LINK ENSTPRECHEND ÄNDERN*/
$MM_redirectLoginFailed = "http://localhost/fffk/Templates/nacheinloggen/fehler.php"; /*HIER STEHT DIE WEITERLEITUNG, BEI ONLINESTELLUNG LINK ENSTPRECHEND ÄNDERN*/
$MM_redirecttoReferrer = false;
mysql_select_db($database_verbindung, $verbindung);
$LoginRS__query=sprintf("SELECT strEmail, strPassword FROM tblbenutzer WHERE strEmail=%s AND strPassword=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
/**HIER STEHT DIE TABELLE und DATENFELDER DER DATENBANK DIE FÜRS LOGIN GELTEN sollen!*/
$LoginRS = mysql_query($LoginRS__query, $verbindung) 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=utf-8" />
<title>Unbenanntes Dokument</title>
<script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="../../SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
<link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="../../SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Einloggen</h1>
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="8%">E-Mail</td>
<td width="15%"><span id="sprytextfield1">
<label>
<input type="text" name="strEmail" id="strEmail" />
</label>
<span class="textfieldRequiredMsg">Es muss ein Wert angegeben werden.</span></span></td>
<td width="77%"> </td>
</tr>
<tr>
<td>Password</td>
<td><span id="sprypassword1">
<label>
<input type="password" name="strPassword" id="strPassword" />
</label>
<span class="passwordRequiredMsg">Es muss ein Wert angegeben werden.</span></span></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="anmelden" id="anmelden" value="anmelden" />
</label></td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1");
//-->
</script>
</body>
</html>