This topic is locked

Using <a ref="#name> anchors redirecting to menu page

1/30/2022 19:57:45
PHPRunner General questions
D
Dynamiccomp author

i had inserted some html code into a text area, and when I built the site, and clicked on the link, it took me back to the menu page, why is that?

This is part of the code I have in editor:



* <a href="#Blue_Horse">Import from Blue Horse Entries</a>
* <a href="#fee_instructions">Fee Instructions</a>
* <a href="#payment_instructions">Payment Instructions</a>
*
<a name="Blue_Horse">Import from Blue Horse Entries</a>
To use Blue Horse Entries for transferring entries to your show, you will first need to setup your show on Blue Horse Entries.
This is controlled by Blue Horse Entries and must be done on their web site.
Here is the link to their Home page at URL: https://bluehorseentries.com/
Once logged into your show, you will see a link, 'Import from Blue Horse Entries', on th Admin menu.
We recommend doing this first before setting up divisions as a transfer of entries will load divisions for you.
This will save you some setup work.

why is this taking me to a different page entirely, I don't get it??

Sergey Kornilov admin 1/31/2022

It should work, this is just a HTML code and it should work. I suggest to load that page in the web browser, do 'View source' and make sure that the actual HTML looks correct.

D
Dynamiccomp author 2/1/2022

I looked at the source as well as the URL when I hover over the link, and it is correct. Here is the link to the page in question. https://scoring.dynamicwebhost.net/huntersrun/testing/faq_list.php For testing purposes, the first link is the only one with a name tag on the page. So, if you click on the "Blue Horse Entries" link it takes you back to the menu page.

Here is the snippet of source code in question



* <a href="#Blue_Horse">## Blue Horse Entries</a>
* <a href="#fee_instructions">## Fee Instructions</a>
* <a href="#payment_instructions">## Payment Instructions</a>
* <a href="#deficiencies">## Managing Public and Private Comments including missing Signatures</a>
* <a href="#scratching_entry">## Scratching an Entry</a>
* <a href="#controlling_display_ride_times">## Controlling Display of Ride Times</a>
* <a href="#overview">## Division Overview</a>
<a name="Blue_Horse"># Blue Horse Entries</a>

To use Blue Horse Entries for transferring entries to your show, you will first need to setup your show on Blue Horse Entries.
This is controlled by Blue Horse Entries and must be done on their web site.
Here is the link to their Home page at URL: <a target="Blue_Horse" <a href="https://bluehorseentries.com/">https://bluehorseentries.com/</a>;.

Sergey Kornilov admin 2/1/2022

I see two issues here.

  1. The way you create anchors is incorrect. It may still work but it makes more sense to use the recommended way:
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_an_element_on_the_same_page


  2. PHPRunner adds <base> tag to every page and it doesn't work well with anchor links. If you mouse over your links you can see that faq_list.php is not present in the URL. You can read more about how to make anchors work with base tag. Maybe the simplest option is to specify your links as follows:
    <a href="faq_list.php#Blue_Horse">## Blue Horse Entries</a>