Each page is invoked via
<a href="index.php?view=page1&ab=zz">Link1 to page1</a>index.php assembles a filename based on the view and ab parameters yielding something like
/pages/page1.php
Using the PHP Require function it loads a header file, then the page body file, then a footer file.
In some situations I want to be able to go to a page, either from a menu or via a link in, say, page1, but I want to be able to go to somewhere other than the start of the page.
So for example, I may have a drop down menu with the first line going to page1 at the top, the 2nd line goes to page1#section2, 3rd line to page1#section3, and so on.
If I was giving the URL in an anchor I'd put something like
http://www.aaa.ooo.uk/pages/page1.php#section1I can't seem to be able to do this in the structure I'm using. Thus, in the menu I've tried lines like the following
<a href="index.php?view=page1&ab=zz">When?</a>The first above works, and goes to top of page
<a href="index.php?view=page1&ab=zz&loc=when">When?</a>
<a href="index.php#when?view=page1&ab=zz">When?</a>
The second works, goes to top of page, and PHP at the start of the page can see the loc param and, ideally, if I could "goto loc" in the PHP, or generate HTML that would do so, problem solved.
The third goes to the index (home) page.
A PHP generated GOTO equivalent
Any suggestions as to how I can achieve this?
Tony



Print Thread
cheshire_man