Help with auto-generated menu

Posted on 2006-04-01
Medium Priority
Last Modified: 2006-11-18
Using the Auto-generated menu here that reads [h#] for the menu:


How can I do this from outside the file, with many files?

For example, I have a standard menu included in each file, that has a link to each file.  I would like to include a submenu based on the headings of each file as the above link does.

For example


Introduction link
  - link to H2 (1)
  - link to H2 (2)
  - link to H2 (3)
Page1 link
  - link to H2 (1)
  - link to H2 (2)
  - link to H2 (3)
Page2 link
  - link to H2 (1)
  - link to H2 (2)
  - link to H2 (3)

Question by:galneweinhaw
1 Comment
LVL 49

Accepted Solution

Roonaan earned 2000 total points
ID: 16350142
You wouldn't want to do that on each hit, because your website would become very slow because of the number of files that need to be accessed on each and every request..

When you realy need this kind of setup it is usually better to only show the main menu items, and show the subheader only when you are in the corresponding file.
Another approach might be to use caching, but this would still involve a large amount of file/hard disk interaction.

A third way is to hardcode the menu, or drive it from a database.


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question