I have a fn() that creates menus from a database file. The code is simple
Code: Select all
while ($sql = mysql_fetch_object($result))
{
$filename = $sql -> Link;
$Text = $sql -> Title;
if ($menuname == "Gallery")
{
$image = $sql ->Image;
$CssClass = $sql ->CssClass;
echo "<li class = $CssClass >";
echo "<a href= $filename ><img src = $image ></a>";
}
else {
echo '<li>';
echo "<a href= $filename >$Text</a>";
}
echo '</li>';
}-- called from dirA I end up with the link being http://www.xyz.com/dirA/filename.php
-- called from dirB I end up with the link being http://www.xyz.com/dirB/filename.php
the database just has filename.php, no path info at all.
I just want the path to be static so I can just load these menus from anywhere. Any suggestions appreciated. I am new at this stuff so sorry if it is beginner type question.
~pickle: Please use proper code tags "code=php", "code=html", etc