Change password

Status
Not open for further replies.
This in my codes)))
options_password.php
Code:
<phpl>
<head>
<LINK REL="StyleSheet" HREF="style.css" TYPE="text/css">
</head>
<body style="background-image:url(http://put image url here);" width="100%">

	<table border=0 cellspacing=0 cellpadding=0 width=100%>
	  <tr><td style='background-color:#0D0304; padding-left:15px; height:15px; solid black; padding-bottom:2px;'>
	     <font color='#DA0000'><b>[ .:Change password:. ]</b></font>
	  </td></tr>
	  <tr><td style="padding-top:2px;">
		<div style="background-color:#781722; padding-top:25px; padding-bottom:6px; margin-bottom:7px; margin-left:5px; margin-right:5px; height:120px; border:2 solid black;">
			<font color='#EB917B'>
<center>
<form name="form1" method="post" action="chgpwddone.php">
          <table width="240" border="0" cellspacing="1" cellpadding="0">
            <tr> 
              <td width="100"><font>Login ID:</font></td><td width="100">
			<input name="login" type="text" id="login" maxlength="10">
		</td>
            </tr>
            <tr> 
              <td width="100"><font>Old Password:</font></td>
              <td>
                <input name="oldpwd" type="password" id="oldpwd" maxlength="10">
                </td>
            </tr>
            <tr> 
              <td width="100"><font>New Password:</font></td>
              <td><input name="newpwd" type="password" id="newpwd" maxlength="10">
                </td>
            </tr>
            <tr> 
              <td width="100"> </td>
            </tr>
            <tr> 
              <td width="100" align="right">                <input type="submit" name="Submit" value="Submit">                </td>
              <td>                <input type="reset" name="Submit2" value="Reset">                </td>
            </tr>
          </table>
        </form>
</center>
</font>
	</div>
 </td></tr>
</table>
</body>
chgpwddone.php
Code:
<html>
<body style="background-image:url(http://and here img);">
<?php
require 'config.htpasswd';
$msconnect=mssql_connect("$dbhost","$dbuser","$dbpasswd");
$msdb=mssql_select_db("MuOnline",$msconnect);

require_once "sql_inject.php"; 
include_once('sql_check.php');
check_inject();

$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect)  ; 


$login = stripslashes($_POST['login']);
$oldpwd = stripslashes($_POST['oldpwd']);
$newpwd = stripslashes($_POST['newpwd']);	

if ((eregi("[^a-zA-Z0-9_-]", $login)) || (eregi("[^a-zA-Z0-9_-]", $oldpwd)) || (eregi("[^a-zA-Z0-9_-]", $newpwd)) ) 
	{
	echo("SQL Injection Detected");
        exit();
	}

$sql_username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$username_check = mssql_num_rows($sql_username_check); 

$sql_pw_check = mssql_query("SELECT memb__pwd FROM MEMB_INFO WHERE memb__pwd='$oldpwd' and memb___id='$login'"); 
$pw_check = mssql_num_rows($sql_pw_check); 

if (empty($login) || empty($newpwd) || empty($oldpwd)) {
    echo "Error: Some fields were left blank. Please go back and try again.<br>";
}

elseif ($username_check <= 0){ 
        echo "Error: Your Login does not exist in our database. Please go back and try again.<br>"; }

elseif ($pw_check <= 0){ 
        echo "Error: Your Old Password does not exist in our database. Please go back and try again.<br>"; }

elseif ($oldpwd==$newpwd) {
    echo "Error: Your Old and New password are the same, so no change was comited.<br>";
}

else {	
$msquery = "UPDATE dbo.MEMB_INFO
SET memb__pwd = '$newpwd'
WHERE memb___id = '$login'
AND memb__pwd = '$oldpwd'";


$sqlinject->test($msquery); 
$msresults= mssql_query($msquery);
echo "<font size='4' face='verdana'>Your account's password has been changed 
        succesfully. <br>You can now play in our server. Your account is:<p>
        Login ID:<b> $login</b><br>
        Password:<b> $newpwd </b></font>";}
		?>
</body>
</html>
 
Upvote 0
Status
Not open for further replies.
Back