My website has many pages. All these pages have the same exact header at the top, displaying the logged-in user's options and links to different sections of the website.
I realized that if I ever want to make changes to the appearance of this header, I'd need to go through and apply the changes to each and every page. This seems like an issue I could avoid, so I decided to store the code in a mySQL data point, and simply echo it back on each page.
So far, it worked out impressively well, but any PHP code I have within it (like displaying the user's name) only return the physical code itself, not the result.
Calling the code works just fine, so here's the actual mySQL entry that's being called:
<table width="1332" border="0" cellspacing="0"><tr>
<td width="1002" style="background-color:#4DDB4D;">
<a href="http://www.AGLgaming.com/login/home"><img src="http://i378.photobucket.com/albums/oo223/Abyssion180/AGLLogoAlternate.png" alt="AGL Logo" width=170 height=90 align="left" /></a>
<img src="http://i378.photobucket.com/albums/oo223/Abyssion180/AGLBanner.png" width=825 height=90 />
</td>
<td width="330" style="background-color:#4DDB4D" align="right">
<div class="ex1">
<a href="http://www.AGLgaming.com/login/home/profile"><font color="blue" size="5">' . $user[0][0] . '</font></a>,<br>
<font size="1">Logged in: </font><a href="http://www.AGLgaming.com/login/home/logout"><font size="2" color="blue">Logout</font></a>
</div></td></tr>
<tr><td valign="center" style="background-color:#6EFF6E;height:31px;">
<div align="left"> ||
<a href="http://www.AGLgaming.com/login/home/forums"><font color="blue" size="5">Forums</font></a> |||
<a href="http://www.AGLgaming.com/login/home/guides"><font color="blue" size="5">Guides</font></a> |||
<a href="http://www.AGLgaming.com/login/home/external"><font color="blue" size="5">External</font></a> |||
<a href="http://www.AGLgaming.com/login/home/members"><font color="blue" size="5">Members</font></a> |||
<a href="http://www.AGLgaming.com/login/home/tournament"><font color="blue" size="5">Tournament</font></a> |||
<a href="http://www.AGLgaming.com/login/home/constitution_of_the_AGL"><font color="blue" size="5">Constitution of the AGL</font></a></div>
</td>
<td valign="center" style="background-color:#6EFF6E;height:31px;">
<div class="ex1" align="right">
<a href="http://www.AGLgaming.com/login/home/profile"><font color="blue" size="3">Profile</font></a> |
<a href="http://www.AGLgaming.com/login/home/denarii"><font color="blue" size="3">Denarii</font></a>: ' . $user[0][7] . ' |
<a href="http://www.AGLgaming.com/login/home/messages"><font color="blue" size="3">Messages</font></a>: ' . $user[0][9]; if($user[0][10]>0) echo '<font size="2"><b>(' . $user[0][10] . ' New!)</b></font>'; . ' |
<a href="http://www.AGLgaming.com/login/home/settings"><font color="blue" size="3">Settings</font></a>
</div>
</td></tr></table>