Code: Select all
<?php
include_once 'connect.php';
session_start();
include_once 'logo.php';
?>
<?php
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$pid = $playerinfo3['id'];
?>
//////////////////////////Experience Death Penalty////////////////
<?php
$firstmod = (int)($playerinfo3['exper'] * .07);
$totalexper =$playerinfo3['exper'] - $firstmod;
$totalexper = $totalexper;
echo "<br><b><big>You died, you lost " . $firstmod . " experience.</b></big><br>";
$updateplayer="update players set exper='$totalexper' where name = '$player'";
mysql_query($updateplayer) or die("Could not update player");
echo "<br><br><a href='index.php'>Go back to town";
$updateplayer="update players set hpoints='1' where name='$player'";
mysql_query($updateplayer) or die("Could not update player");
?>