Smarter Menu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Smarter Menu

Post by Vegan »

On my site, you see a block called NAVIGATION. Its simple HTML at present. What I would like is to show links programatically only if the document is available. Also to have no link for the focus document.

See my site, if you want to see the layout.

Thoughts?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: Smarter Menu

Post by it2051229 »

so uhmm did you start coding it in php?

like

if(there is content)
{
echo "<a href='#'>Whatever Link</a>";
}
else
{
echo "Whatever Link";
}
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: Smarter Menu

Post by Vegan »

Yes, I first started with an ad tool, so the next idea was to mechanize the menu. May as well figure out PHP better.

So what is the best conditional test for a file existence?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Smarter Menu

Post by McInfo »

If you reference a site in your post, please provide a link. Some people have signatures disabled (me) and you might change your signature someday.

Further, some people don't want to follow off-site links (me again), so take some time to post some code (only the relevant parts).
Vegan wrote:So what is the best conditional test for a file existence?
PHP Manual: file_exists()

Edit: This post was recovered from search engine cache.
Post Reply