Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to enter links in php


pikoro

Recommended Posts

Hi,

 

This should be a relatively simple problem.

I am trying to enter a link to the Contact Us page from includes/languages/english/aboutus.php.

This is a page I added to the Information box, following the instructions on the KB, and it works fine.

The link is there and it works, only that it gives me a persistent "404 not found" error.

I tried to take it up to the root, one level at a time, using ../ the relative path, and adding as needed, but always getting the same error.

So, how do I enter a link in a .php page?

BTW, I just started with php.

Thanks and Happy New Year.

Link to comment
Share on other sites

Give this a try
<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> Contact Us</a>

 

Jack

 

Thanks Jack, it worked!

Now, could you please explain the process?

What does tep mean?

I believe that it is pulling the page from the database, but not sure.

Please refer me to manuals or any informational links that explain how osCommerce works.

I will ask less questions and maybe answer more...

Enjoy your holidays.

Link to comment
Share on other sites

The tep_href_link is a function delcared in includes/functions/html_output.php. The tep part is just a naming convention used in the shop. The function creates a link to pages within your shop. You need to use it instead of a normal html link since the normal one does not add the session ID that oscommerce uses to track a visitors movement throughout the shop. The capital letters, FILENAME_CONTACT_US, is a defined value in includes/filenames.php. It is just an alias for contact_us.php.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The tep_href_link is a function delcared in includes/functions/html_output.php. The tep part is just a naming convention used in the shop. The function creates a link to pages within your shop. You need to use it instead of a normal html link since the normal one does not add the session ID that oscommerce uses to track a visitors movement throughout the shop. The capital letters, FILENAME_CONTACT_US, is a defined value in includes/filenames.php. It is just an alias for contact_us.php.

 

Jack

Jack, using the link format you described, how would I go about linking to a page that needs to be viewed securely, as in making the link a https://? Since I don't know how to do it, I've had to replace certain links in the php files with the full HTML link, which you say is not the best thing to do.

Link to comment
Share on other sites

Change
FILENAME_CONTACT_US)

to

FILENAME_CONTACT_US, '', 'SSL')

 

Jack

 

Jack,

 

All this information is very valuable to me, including the response to the other user, thank you.

There is an oddity in osCommerce that I can't figure out.

I can manipulate the appearance of links in the stylesheet, however there was no selector there for a:visited.

I added it but it doesn't render anything, it is the only link selector that doesn't work.

What is the explanation for this?

Thanks in advance.

Link to comment
Share on other sites

It works fine here. Not all links in the shop use the A class so be sure you are adding it to the correct one.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It works fine here. Not all links in the shop use the A class so be sure you are adding it to the correct one.

 

Jack

 

Jack,

 

This is an excerpt from my stylesheet:

 

A {

color: #3366FF;

text-decoration: none;

}

 

A:hover {

color: #AABBDD;

text-decoration: underline;

}

 

A:visited {

color: ##990099;

text-decoration: none;

}

 

What baffles me is that the same link reacts to the first two statements but not to the third.

Any ideas?

Happy New Year to you and family.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...