I've began working on my game again. Actually, just starting completely from scratch. Things have come back to me quickly, but I'm having an issue with the progress bar that shows the health of the player. I have the exact same as the older tutorials, and it works there, but doesn't work on my script. Below is my code.... anyone see anything wrong?
Code: Select all
<?php
$sql = "SELECT * FROM users WHERE id = '$_SESSION[userid]'";
$user_query2 = mysqli_query($db_conx, $sql);
$numrows = mysqli_num_rows($user_query2);
$row = mysqli_fetch_array($user_query2, MYSQLI_ASSOC);
?>
<link rel="stylesheet" href="style/style.css">
<div id="hpointsback">
<?php
echo "<img src='images/hitpoints2.png'>";
?>
</div>
<div id="hpointsfront">
<?php
$width = ($row['hpoints'] / $row['maxhp']) * 100;
echo "<img src='images/hitpoints1.png' width='$width' height='15' >";
?>
</div>
Code: Select all
#hpointsfront {
position:absolute;
left:1500px;
top:300px;
width:100px;
height:15px;
z-index:1;
}
#hpointsback {
position:absolute;
left:1500px;
top:300px;
width:100px;
height:15px;
z-index:2;
text-align:left;
}
http://gyazo.com/4b0f2cdc6e10c35043a8171cbe57b63a
This is what it shows in Firefox:
http://gyazo.com/44e74f9314bb96f650c12aad3c266222