chojrak
Banned User
- Joined
- Oct 25, 2008
- Messages
- 5,832
- Solutions
- 2
- Reaction score
- 160
Orginal Idea: http://otland.net/f295/gesior-acc-add-points-form-39693/
Nothing more to write. ;P
Code:
<?
// points manager by chojrak ;p
session_start();
// connection info
mysql_connect("localhost", "root", "password");
mysql_select_db("otserv");
// manager config
$login = "r00t";
$password = "p4ss";
$content = "<center>";
if ($_POST)
{
if (!isSet($_SESSION['access']))
{
if ($_POST['l'] == $login && $_POST['p'] == $password)
{
$content .= "You are successfully logged in.<br/>Please click <a href='./points.php'>here</a>.";
$_SESSION['access'] = true;
}
else
$content .= "<img src='http://steynian.files.wordpress.com/2008/08/access_denied.gif'/>";
}
else
{
$player = $_POST['player'];
$points = $_POST['points'];
$p_query = mysql_query("SELECT * FROM `players` WHERE `name` = '".$player."';");
$p_data = mysql_fetch_array($p_query);
mysql_query("UPDATE `accounts` SET `premium_points` = `premium_points` + '".$points."' WHERE `id` = '".$p_data['account_id']."'");
$content .= $points." of premium points added to account of player ".$player.".";
}
}
else
{
if (!isSet($_SESSION['access']))
{
$content .= "<form method='post' action='points.php'>
<table width='250' cellspacing='0' border='1'>
<tr>
<td align='left'>Access Panel</td>
</tr>
<tr>
<td align='center'>
Login:
<br/>
<input type='password' name='l'/>
<br/><br/>
Password:
<br/>
<input type='password' name='p'/>
<br/><br/>
<input type='submit' name='access_account' value='Access account.'/>
</td>
</tr>
</table>
</form>";
}
else
{
$content .= "<form method='post' action='points.php'>
<table width='250' cellspacing='0' border='1'>
<tr>
<td align='left'>Add Points</td>
</tr>
<tr>
<td align='center'>
Player name:
<br/>
<input type='text' name='player'/>
<br/><br/>
Points:
<br/>
<input type='text' name='points'/>
<br/><br/>
<input type='submit' name='add_points' value='Give points.'/>
</td>
</tr>
</table>
</form>";
}
}
$content .= "</center>";
echo $content;
?>
Nothing more to write. ;P