Because I you guys so much, here is my logout.php page that I made from a modified registration page that came with Basic Server v2. All it does is let you login to verify you own the account and then UPDATE user_credentials SET loggedin='0' where name='$name
Code:
<?php
define('ROOT', './');
include ROOT.'common/common.php';
include ROOT.'common/header.php';
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$pass = $_POST['pass'];
$newpass = $_POST['newpass'];
if("$name" == "")
{
echo "<fieldset class=\"menu main\"><b>Manual Logout Error</b><br>Please enter a username...<br><br><a href=logout.php>Go Back</a></fieldset>";
define('ROOT', './');
include ROOT.'common/footer.php';
}
else
if("$pass" == "")
{
echo "<fieldset class=\"menu main\"><b>Manual Logout Error</b><br>Please enter your current password...<br><br><a href=logout.php>Go Back</a></fieldset>";
define('ROOT', './');
include ROOT.'common/footer.php';
}
else
/*if("$newpass" == "")
{
echo "<fieldset class=\"menu main\"><b>Manual Logout Error</b><br>Please enter a new password...<br><br><a href=logout.php>Go Back</a></fieldset>";
define('ROOT', './');
include ROOT.'common/footer.php';
}
else*/
// set your username and password and change localhost to the IP of your MYSQL server unless it is hosted locally...
$con = mysql_connect("localhost","USERNAME","PASSWORD");
if (!$con)
{
die('' . mysql_error());
}
mysql_select_db("DATABASE_NAME", $con);
$result = mysql_query("SELECT pass FROM user_credentials where name='$name'");
$thepass = mysql_result($result, 0);
if("'$pass'" == "'$thepass'")
{
mysql_query("UPDATE user_credentials SET loggedin='0' where name='$name'");
//
// mysql_query("UPDATE user_credentials SET pass='$newpass' where //name='$name'");
echo "<fieldset class=\"menu main\"><b>Manual Logout</b><br>Your account has been manually logged out...<br><br><a href=logout.php>Go Back</a></fieldset>";
include ROOT.'common/footer.php';
}
else
{
echo "<fieldset class=\"menu main\"><b>Manual Logout Error</b><br>Incorrect password...<br><br><a href=logout.php>Go Back</a></fieldset>";
define('ROOT', './');
include ROOT.'common/footer.php';
}
mysql_close($con);
}
?>
<style type="text/css">
<!--
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
}
-->
</style>
<fieldset class="menu main">
<b>Manual Logout</b>
<p>This tool is to be used when the a player tries to log in and the server glitches and says that they are already logged in.</p>
<br />
<form action="<?php echo basename($_SERVER['PHP_SELF']); ?>" method="POST">
<table>
<tr>
<td><span class="style7">Username:</span></td>
<td><input name="name" type="text" id="name" /></td>
</tr>
<tr>
<td><span class="style7">Current Password:</span></td>
<td><input name="pass" type="password" id="pass" value="" maxlength="20" /></td>
</tr>
<!-- <tr>
<td><span class="style7">New Password:</span></td>
<td><input name="newpass" type="password" id="newpass" value="" maxlength="20" /></td>
</tr> -->
<tr>
<td colspan="2"><input type="submit" name="submit" value="Fix my account!" /></td>
</tr>
</table>
</form>
</fieldset>
<?php
include ROOT.'common/footer.php';