- Joined
- Apr 8, 2009
- Messages
- 60
- Reaction score
- 8
Hi all,
I noticed that some of you wanted a script that can change passwords of existing accounts. Well, here it is:
How to use:
#1: Change YOURHOST and YOURPASSWORD at the top of this script to your host and your database password
#2: Save this script as changepass.php
#3: Enjoy!
Credits:
Credits go to me!
If you use this script for public servers, please be aware that It can be easily abused.
I noticed that some of you wanted a script that can change passwords of existing accounts. Well, here it is:
PHP:
<?php
//This script was created by Diumelia for ragezone forums.
ini_set('display_errors', 0);
$connection = mssql_connect('YOURHOST', 'sa', 'YOURPASSWORD'); // <<== Change YOURHOST and YOURPASSWORD
if(!connection || !mssql_select_db('ACCOUNT_DBF', $connection))
{
die('Unable to connect or select database!');
}
$checkusername = $_POST['Username'];
$query = mssql_query("SELECT account FROM ACCOUNT_TBL WHERE account = '$checkusername'");
$result = mssql_fetch_row($query);
$checkpassword = $_POST['FirstPassword'];
$query2 = mssql_query("SELECT password FROM ACCOUNT_TBL WHERE account = '$checkusername'");
$resultpass = mssql_fetch_row($query2);
$passwordcheck = md5('nForceIsGay' . $_POST['FirstPassword']);
if(isset($_POST['submit'])){
if($_POST['Username'] == ""){
$error = '<font color="red">Please enter a username.</font>';
}
else if($result[0] != $checkusername){
$error = '<font color="red">This username doesn\'t exist. </font>';
}
else if($_POST['FirstPassword'] == ""){
$error = '<font color="red">Please enter your password.</font>';
}
else if($passwordcheck != $resultpass[0]){
$error = '<font color="red">Please enter the correct password.</font>';
}
else if($_POST['NewPassword'] == ""){
$error = '<font color="red">Please enter a new password.</font>';
}
else if($_POST['NewPassword2'] == ""){
$error = '<font color="red">Please repeat your new password.</font>';
}
else if($_POST['NewPassword'] != $_POST['NewPassword2']){
$error = '<font color="red">New passwords do not match.</font>';
}
else{
$NewPassword = md5('nForceIsGay' . $_POST['NewPassword']);
mssql_query("UPDATE ACCOUNT_TBL SET password = '$NewPassword' WHERE account = '$checkusername'");
$error = '<font color="green">Your password has been succesfully changed!</font>';
}
}
echo '<form action="changepass.php" method="post"><br />';
echo 'Username: <input type="text" name="Username" /><br />';
echo 'Password: <input type="password" name="FirstPassword" /><br />';
echo 'New password: <input type="password" name="NewPassword" /><br />';
echo 'Repeat new password: <input type="password" name="NewPassword2" /><br />';
echo '<input type="submit" name="submit" value="Change" /><br /><br />';
echo '</form>';
echo $error
?>
How to use:
#1: Change YOURHOST and YOURPASSWORD at the top of this script to your host and your database password
#2: Save this script as changepass.php
#3: Enjoy!
Credits:
Credits go to me!
If you use this script for public servers, please be aware that It can be easily abused.

