Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Back to top link going to homepage

Dr Lemons

Recommended Posts

I have a back to top link on one of my pages for my oscommerce store.


I have <a name="top"></a> at the top of the page.


and <a href="#top">Go to the top of the page</a> at the bottom of the page. However when i click on it it goes to the homepage.


I have changed it to <a href="mypagename.php#top"></a> and this solves the problem but i want to know why it doesn't work by just using #top within the href as it should normally.


Is there something within OsCommerce which does not allow this?



Thanks :thumbsup:


edit : I have found out why it is not working. It is because of: <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />


Can anybody tell me is this part important?

Link to comment
Share on other sites

The <base> tag tells the browser where all relative links (<a> tags) are relative to. You can look in the HTML page source on your browser (View > Page Source) and see what the <base> tag says. It sounds like it's specifying the WS_CATALOG and is something like /catalog. Your solution to explicitly name the page sounds reasonable.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...