Yes, this is an include file that is included just below the retrieval of players information.
Let me get where its included.. or an example of one of the pages its included on
but before I do that, this is the whole include file:
Code: Select all
<div id="gold">
<?php
echo "<b><big><u>Gold</u></big></b><br>";
echo $playerinfo3['gold'];
?>
</div>
<div id="activity">
<?php
echo "<b><big><u>Activity</u></big></b><br>";
echo $playerinfo3['activity'];
?>
</div>
<div id="hungry">
<?php
echo "<b><big><u>Hungry</u></big></b><br>";
if ($playerinfo3['hungry'] = '4'):
{
echo "Not Hungry";
}
elseif ($playerinfo3['hungry'] = '3'):
{
echo "Hungry";
}
elseif ($playerinfo3['hungry'] = '2'):
{
echo "Very Hungry";
}
elseif ($playerinfo3['hungry'] = '1'):
{
echo "Starving";
}
endif;
?>
</div>
Now this is one of the pages that it is included on:
Code: Select all
<?php
include_once 'connect.php';
session_start();
include_once 'logo.php'; //// normal part of tutorial
include_once 'session.php'; /// this inlude file does the player retrieval and the get session stuff
include_once 'playerinfo.php'; ///this is the inlcude file for gold, hungry, activity
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<div id="login2" div align="center">
</div>
<div id ="locations">
<?php
$playerhp = $playerinfo3['hitpoints'];
if ($playerhp < 1)
{
echo "You are dead!" ;
echo "<br><a href='useitem.php>Use an Item";
exit;
}
echo "<b><big><u>Locations</u></big></b><br>";
echo "<a href='home.php'>House<br></a>";
echo "<a href='townhall.php'>Town Hall<br></a>";
echo "<a href='blacksmith.php'>Blacksmith<br></a>";
echo "<a href='Merchant.php'>Merchant<br></a>";
echo "<a href='jobs.php'>Find Jobs<br></a>";
?>
</div>
<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'></a>";
?>
</div>
Just so you know the gold and activity... actually just the gold... i cant alter activity yet... the gold updates nicely... but the hungry is not updating I believe it has to do with the code I posted in my first post.
Code: Select all
<?php
echo "<b><big><u>Hungry</u></big></b><br>";
if ($playerinfo3['hungry'] = '4'):
{
echo "Not Hungry";
}
elseif ($playerinfo3['hungry'] = '3'):
{
echo "Hungry";
}
elseif ($playerinfo3['hungry'] = '2'):
{
echo "Very Hungry";
}
elseif ($playerinfo3['hungry'] = '1'):
{
echo "Starving";
}
endif;
?>