Kan ikke skifte password
Denne kode her er oprettet sådan at man indtaster brugernavn, gammel password, nyt password, gentag nyt password.Uanset hvad jeg gør får jeg denne meddelse: Der er en fejl i dine indtasninger, prøv igen
<?php require_once('../Connections/cms.php'); ?>
<?php
$colname_rs_update = "1";
if (isset($_POST['brugernavn'])) {
$colname_rs_update = (get_magic_quotes_gpc()) ? $_POST['brugernavn'] : addslashes($_POST['brugernavn']);
}
mysql_select_db($database_cms, $cms);
$query_rs_update = sprintf("SELECT * FROM brugere WHERE brugernavn = '%s'", $colname_rs_update);
$rs_update = mysql_query($query_rs_update, $cms) or die(mysql_error());
$row_rs_update = mysql_fetch_assoc($rs_update);
$totalRows_rs_update = mysql_num_rows($rs_update);
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if (isset($_POST['id'])) {
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "code") && ($_POST['gammel_password']==$row_rs_update['adgangskode']) && ($_POST['nyt_password']==$_POST['gentag_password'])) {
$updateSQL = sprintf("UPDATE brugere SET adgangskode='%s' WHERE brugernavn='%s'",
$_POST['nyt_password'],
$_POST['brugernavn']);
mysql_select_db($database_cms, $cms);
$Result1 = mysql_query($updateSQL, $cms) or die(mysql_error());
$result="<b style='color: #0000ff;'>Koden er blevet ændret</b>";
}
else $result="<b style='color: #ff0000;'>Der er en fejl i dine indtasninger, prøv igen</b>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Ændring af password</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../css/styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #666666;
font-weight: bold;
font-size: 12px;
}
body {
background-image: url(../img/baggrund.jpg);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
height: 100%
}
.style2 {
font-size: 24px;
color: #000000;
}
.style3 {color: #333333}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
</head>
<body>
<table width="722" border="0" align="center" bgcolor="#FFFFFF" class="layout">
<tr>
<td colspan="2" class="top style1"><table width="722" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="80" bgcolor="#CCCCCC"><div align="center"><span class="style2">Administration > Skift dit password < </span></div></td>
</tr>
<tr>
<td align="right"><div align="right"><a href="#" onClick="MM_callJS('java script:window.close();')" onMouseOver="MM_swapImage('Image1','','img/adm_29_over.gif',0)" onMouseOut="MM_swapImgRestore()"><img src="img/adm_29.gif" name="Image1" width="80" height="22" border="0"></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td class="top1"> </td>
<td class="top1"><?php echo $result; ?></td>
</tr>
<tr>
<td class="left"><p> </p>
<p align="center"><a href="index.php"></a> </p></td>
<td class="middle">
<form action="<?php echo $editFormAction; ?>" method="POST" name="code" id="code">
<table width="623" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="146"><div align="right" class="style3">Brugernavn:</div></td>
<td width="152"><input name="brugernavn" type="text" id="brugernavn" size="25"></td>
<td width="147"><div align="right" class="style3">Gammel password: </div></td>
<td width="154"><input name="gammel_password" type="password" id="gammel password" size="25"></td>
</tr>
<tr>
<td><div align="right" class="style3">Nyt password: </div></td>
<td><input name="nyt_password" type="password" id="nyt password" size="25"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style3">Gentag password: </div></td>
<td><input name="gentag_password" type="password" id="gentag password" size="25"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="udfør" type="submit" id="udfør" value="Udfør"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="hidden" name="id" value="<?php echo $colname_rs_update ?>"></td>
<td> </td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="code">
</form> <p> </p>
<p> </p>
<p> </p> <p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rs_update);
?>