Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST['change_pw']){
- $username = mysql_real_escape_string($_POST['username']);
- $password = mysql_real_escape_string($_POST['password']);
- if(empty($username)){
- echo '<div class = "alert">You have not entered a username??</div>';
- }
- else if(empty ($password)){
- echo '<div class = "alert">You have not entered a password??</div>';
- }
- else if(!isset($username) || !ctype_alpha($_POST['username'])){
- echo '<div class = "alert">Username can only contain letters.</div>';
- }
- mysql_query( "UPDATE users SET password = '" . $core->hashed($password) ."' WHERE username = '{$username}'" );
- mysql_query($q_editn);
- echo '<div class = \'alert\'>Password changed successfully.</div><meta http-equiv="refresh" content="3;url={url}/index.php?url=hk&change_password"/>';
- }
- }?>
- <br>
- <form method = "post">
- <input type = "text" name = "username" value = "<?php echo $_POST['username']; ?>" placeholder = "Username"></br></br>
- <input type = "password" name = "password" placeholder = "Password"></br></br>
- <input type = "submit" name = "change_pw">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement