Hello,
I have a problem I am trying to solve, regarding anchors.
I have a database of articles, with the following structure:
tablename: article
fields: id, idheading, part, subpart, subpartheading, text.
id is the article id, idheading is the whole article heading, part is to detemine how much webpages should the article be divided into, subpart is to identify where to put an anchor tag, subpartheading is the sub-heading for this part, and text is the part's text.
Example for data:
1, "How to code PHP", 1, 1, "What is PHP?", "Text...."
1, "How to code PHP", 1, 2, "When did PHP Start?", "Text...."
1, "How to code PHP", 1, 3, "Before We Begin", "Text...."
1, "How to code PHP", 2, 1, "Coding Essentials", "Text...."
1, "How to code PHP", 2, 2, "Functions", "Text...."
.
.
.
etc.
Now, my problem is, that I want articles not to stretch too long down the browser, so I will divide them according to the field "part". However, I want each page to contain the whole table of contents, which I will build dynamically, according to "subpartheading". Now, the big question - how can I open a php generated page, and make the page jump to an anchor tag (let's say, the user clicks the heading "Functions", which is subpart 2 of part 2, while he is on part 1 of the article)? I have no problem generating a page with SELECT...WHERE part=2, but how do I make the page jump to the "Functions" section?
Thanks,
Oren