Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "./includes/header.php";
- include "./includes/menu.php";
- if(isset($_POST['changepw'])){
- $oldpw = md5($_POST['oldpassword']);
- $newpw = md5($_POST['newpassword']);
- $id = $_SESSION['SESS_MEMBER_ID'];
- $sql = mysql_query("SELECT * from accounts WHERE id = '$id' AND password = '$oldpw'");
- $sql_c = mysql_num_rows($sql);
- if ($sql_c > 0) {
- mysql_query("UPDATE accounts SET password = '$newpw' WHERE id = '$id'")
- or die(mysql_error());
- header("Location: ./changepw-done.php"); }
- else {
- header("Location: ./changepw-error.php"); }
- }
- ?>
- <hr class="noscreen" />
- <div id="skip-menu"></div>
- <div id="content">
- <div id="content-box">
- <!-- Left column -->
- <div id="content-box-in-left">
- <div id="content-box-in-left-in">
- <p><center>
- <form id="changepw" name="changepw" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
- <table align="center" border="0" width="65%" height="128">
- <tr>
- <td width="45%" height="19"><strong><font color="#888888" size="3">Current Passwod: </font></strong><br /><br /></td>
- <td width="55%" height="19"><input maxlength="25" name="oldpassword" type="text" value="" size="31"><br /><br /></td>
- </tr>
- <tr> <td><input type="hidden" name="gamename" value="{$user->gamename}"/></td> </tr>
- <tr>
- <td width="45%" height="19"><strong><font color="#888888" size="3">New Password:</font> </strong></td>
- <td width="55%" height="19"><input maxlength="25" name="newpassword" type="text" value="" size="31"><br /><br /></td>
- </tr>
- <tr>
- <td colspan="2" align="center" width="45%" height="47"><input type="submit" name="changepw" id="changepw" value=" Change Password " /></td>
- </tr>
- </table>
- </form>
- </center></p>
- </div>
- </div>
- <!-- Left column end -->
- <hr class="noscreen" />
- <?php
- include "./includes/leftside.php";
- ?>
- </div>
- </div>
- <hr class="noscreen" />
- <?php
- include "./includes/footer.php";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement