PHP Code:
<?php
include('../functions.php');
ini_set('error_reporting', 'off'); # No error_log file
if(isset($_GET['player']))
{
$uid = mysql_real_escape_string($_GET['player']);
$row = mysql_fetch_array(mysql_query("SELECT user_name, class FROM user_data WHERE user_id='". $uid ."' LIMIT 1"));
$username = $row['user_name'];
$class = $row['class'];
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="de" dir="ltr">
<title>Class Changer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta name="author" content="Playa Games GmbH">
<meta name="publisher" content="Playa Games GmbH">
<meta name="copyright" content="Copyright 2011 Playa Games GmbH">
<meta name="keywords" content="browser games, browsergames, mmorpg, online game, online games, online games kostenlos, online rollenspiel, online rollenspiele, onlinegames, onlinespiel, browsergame, browsergames kostenlos, browserspiele, kostenlose mmorpg, mmorpg online games">
<meta name="description" content="Das lustige Shakes & Fidget Spiel">
<style type="text/css">
body {
background:url(../res/background.jpg);
background-repeat:no-repeat;
background-position:top center;
background-color:#000000;
font-family: Tahoma, Arial, Helvetica, sans-serif;
color: #FFFFFF;
margin: 188px auto auto 0;
}
a:link { text-decoration:none; color:#ffd9aa; }
a:visited { text-decoration:none; color:#ffd9aa; }
a:hover { text-decoration:underline; color:#ffd9aa; }
a:active { text-decoration:none; color:#ffd9aa; }
a:focus { text-decoration:none; color:#ffd9aa; }
h1{
font-size: 1.2em;
font-weight: bold;
padding:0;
margin:0;
margin-bottom: 0.5em;
}
.imprint2 {
margin-top: 130px;
color: #000000;
}
.imprint2 a {
color: #000000;
text-decoration: underline;
}
input[type=text], textarea, input[type=password] {
border: 1px solid #929292;
color: #929292;
padding: 10px;
vertical-align: text-top;
width: 300px;
-webkit-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-moz-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-border-radius: 5px;
-khtml-border-radius: 5px;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px);
}
input[type=submit] {
border: 1px solid #929292;
color: #000;
font-weight: bold;
padding: 10px;
vertical-align: text-top;
width: auto;
-webkit-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-moz-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-border-radius: 5px;
-khtml-border-radius: 5px;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px);
}
</style>
</head>
<body>
<center>
<table align="center" width="570px" style="font-family: Tahoma, Arial, Helvetica, sans-serif; color: #FFFFFF;">
<tbody>
<tr>
<td style="padding: 0; margin:0">
<div style="overflow: auto; height: 360px; padding: 10px">
<?php
if(!isset($_POST["doit"]))
{
?>
<center>
<h1>Benvenuto <b><?=$username?></b>!</h1>
<br>
Scegli la classe che vuoi cambiare è accedi con la tua password.
<br><br>
<form action="#" method="post" enctype="multipart/form-data" target="_self">
<p>
<label><img src="http://www.elitepvpers.com/forum/images/warrior.jpg"></label>
<label><img src="http://www.elitepvpers.com/forum/images/mage.jpg"></label>
<label><img src="http://www.elitepvpers.com/forum/images/hunter.jpg"></label>
</p>
<p>
<Input type = "Radio" Name ="newc" value="1" <?php if($class == '1') echo 'checked="checked"'?>> Guerriero
<Input type = "Radio" Name ="newc" value="2" <?php if($class == '2') echo 'checked="checked"'?>> Mago
<Input type = "Radio" Name ="newc" value="3" <?php if($class == '3') echo 'checked="checked"'?>> Cacciatore
</p>
<input type="password" name="password" size="10" />
<br>
<br>
<input type="submit" value="Conferma!" name="button">
<input type="hidden" name="doit" value="yes" />
<input type="hidden" name="uid" value="<?=$uid?>" />
</form>
</center>
<?php
}
if(isset($_POST["doit"]))
{
$nclass = $_POST["newc"];
$userid = $_POST["uid"];
$pass = $_POST["password"];
$row = mysql_fetch_array(mysql_query("SELECT password FROM user_data WHERE user_id='". $userid ."' LIMIT 1"));
if($row["password"] == md5($pass))
{
mysql_query("UPDATE user_data SET class = '" . $nclass . "' WHERE user_id = '" . $userid . "' LIMIT 1");
echo '<script>window.close();</script><META HTTP-EQUIV="REFRESH" CONTENT="0; URL=../">';
}
else
{
echo '<script>window.close();</script><META HTTP-EQUIV="REFRESH" CONTENT="0; URL=../">';
}
}
?>
</div>
</td>
</tr>
</tbody>
</table>
</center>
</body>
</html>