Jeg får følgende fejl når jeg prøver at logge ind med gyldigt brugernavn og adgangskode (mads , mads123)
Unknown column 'mads' in 'where clause'
her er login siden:
<?php require_once('../Connections/site/con/Donkin_dk12.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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['usern'])) {
$loginUsername=$_POST['usern'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "results.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_Donkin_dk, $Donkin_dk);
$LoginRS__query=sprintf("SELECT `user`, pass FROM login WHERE `user`=%s AND pass=%s",
GetSQLValueString($loginUsername, "-1"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $Donkin_dk) 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']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<p>login:</p>
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<table width="400" cellpadding="6">
<tr>
<td>Brugernavn</td>
<td><input type="text" name="usern" id="usern" tabindex="1" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="pass" id="pass" /></td>
</tr>
<tr>
<td><input type="submit" name="button" id="button" value="Log ind" /></td>
<td> </td>
</tr>
</table>
<br />
</form>
<p> </p>