Newbie Spellweaver
- Joined
- Aug 26, 2005
- Messages
- 58
- Reaction score
- 1
FOR ODINMS
Can be changed for any other by editing fix.php insert value
Re: ID is already logged in when acct is actually logged out..
I found it quite annoying and decided to allow players to fix their accounts themselves without bugging me out..
I will cover how to enable PHP in HTML pages below if your page is running any PHP scripts.
Ok copy these into notepad and save as index.html or anything u wish to put as ur link. U can also put this in any segment of your webpage, it must be .HTML
Copy this into notepad and rename it fix.php
lastly, copy the following into notepad and rename config.php
Lastly Put this into another notepad file and save as ".htaccess"
important, must include the ""
This is to enable PHP in HTML pages
Do those and copy to your PHP enabled webserver, apache mod or Wampserver root folder or whereever ur htdocs/www folder is.
* The .htaccess must be in the same folder as the 3 other files.
Edit
Thanks ddxsamx - pointing out the mistake which would render an error i will definitely get spammed for
Edit
The page to change is NOT the fix.php if u try to go there it will juz give u a download link. The page is the .html page where u EMBEDDED the first code at the top below the bolded words.
Can be changed for any other by editing fix.php insert value
Re: ID is already logged in when acct is actually logged out..
I found it quite annoying and decided to allow players to fix their accounts themselves without bugging me out..
I will cover how to enable PHP in HTML pages below if your page is running any PHP scripts.
Ok copy these into notepad and save as index.html or anything u wish to put as ur link. U can also put this in any segment of your webpage, it must be .HTML
Code:
<form action="fix.php" method="post">
Login: <input name="login" type="text" />
<br><br>
Password: <input name="pass" type="password" />
<br><br>
<input type="submit" value="Fix Login!"/>
</form>
Copy this into notepad and rename it fix.php
Code:
<title>Fix Login</title>
<body background="bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php
include('config.php');
$login = $_POST['login'];
$pass = $_POST['pass'];
$resultsalt = mysql_query("SELECT salt FROM accounts WHERE name='$login'");
if ($row = mysql_fetch_array($resultsalt)){
do {
$salt = $row["salt"];
} while ($row = mysql_fetch_array($resultsalt));
} else {
echo "You need to be logged off before you can do this!";
}
$password = hash('sha512', $pass . $salt);
$sqlquery = "SELECT * FROM accounts WHERE name = '$login' AND password = '$password'";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result); //LINE NUMBER 23
$i = 0;
if ($number < 1) //10
{
echo "This account doesn't exist, or the password is wrong.";
}
else
{
if ($number > $i)
{
$sqlquery2 = "Update accounts SET loggedin = 0 WHERE name='$login'";
mysql_query("$sqlquery2") or DIE (mysql_error());
echo "The account has been unbugged successfully!";
}
}
?>
<center><h5>Credits to Voldermord<h5></center>
lastly, copy the following into notepad and rename config.php
Code:
<?php
//Database details
$host['name'] = 'localhost'; // your host
$host['username'] = 'root'; // your database username
$host['password'] = 'yourpasswordhere'; // your database password
$host['databasename'] = 'odinms'; // your database name
$db = mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to the database');
mysql_select_db($host['databasename'], $db);
?>
Lastly Put this into another notepad file and save as ".htaccess"
important, must include the ""
This is to enable PHP in HTML pages
Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
* The .htaccess must be in the same folder as the 3 other files.
Edit
Thanks ddxsamx - pointing out the mistake which would render an error i will definitely get spammed for
Edit
The page to change is NOT the fix.php if u try to go there it will juz give u a download link. The page is the .html page where u EMBEDDED the first code at the top below the bolded words.
Last edited: