Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to link to another php file?


thisheart

Recommended Posts

Posted

What is the proper way to link to another php file.

 

For example. On my index page I would like a link to my 'about us' file.

 

Do I link directly to about_us.php? Or do I have to worry about the '?cPath=24&products_id=44&osCsid=a6a81e34c5915671c9428c0f35f2a51d' ect?

 

Thanks

Posted

Yes, you have to worry about it because otherwise the session info will be lost (especially the client does not use cookies and/or you are using a shared certificate).

 

If you create a link in your catalog/index.php or better yet in includes/header.php, includes/column_right.php or includes/column_left.php to about_us.php do it like this ...

 

<a href="<?php echo tep_href_link("about_us.php", '', 'NONSSL'); ?>">About Us</a>

 

What I did for my non-osc pages was make a copy of index.php (e.g. to about_us.php) and then added my conent in the main section.

 

that way your customers can click back to any where on the store.

 

also search on "breadcrumbs" and you will see how to edit you bread crumbs so they are accurate.

 

hope that helps, Good luck!

Posted
Yes, you have to worry about it because otherwise the session info will be lost (especially the client does not use cookies and/or you are using a shared certificate).

 

If you create a link in your catalog/index.php or better yet in includes/header.php, includes/column_right.php or includes/column_left.php to about_us.php  do it like this ...

 

<a href="<?php echo tep_href_link("about_us.php", '', 'NONSSL'); ?>">About Us</a>

 

What I did for my non-osc pages was make a copy of index.php (e.g. to about_us.php) and then added my conent in the main section.

 

that way your customers can click back to any where on the store.

 

also search on "breadcrumbs" and you will see how to edit you bread crumbs so they are accurate.

 

hope that helps, Good luck!

 

 

That is great for the links in the mentioned php files.. but what about links in the html areas. For example the /languages/english/index.php

Posted
It's about the same:
<a title="Some Text" href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '"> Some Text</a>

 

Jack

 

 

Thanks,

 

What about adding a roll over image? When I add the code to the index section on the language index.php, it wrecks the code.

Posted

Worked out how to link an image to a product

 

<a href="'. tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=productnumber') . '"><img src="image"></a>

Posted

what about directory structure? for instance, my products pages (external to osc) are located at /products/productname/index.php

 

I used the contrib that passes sessions to external pages, but what about these pages showing up on who's online?

  • 2 weeks later...
Posted

When you create a new page within osCommerce you should do two things:

 

1. Include the osCommerce copyright notice if you are using osCommerce code, classes and functions (you will be if you use the next step).

 

2. Add the following to the top of your new file and use the tep_href_link function for links within the file (except links to external sites etc.):

 

 ?require('includes/application_top.php');

 

These new files (pages) should be placed within your main osCommerce directory.

 

That is all that is needed for any new page you wish to add to osCommerce :D

 

If you wish your page to have header, footer and left and right columns, then use a page such as conditions.php as the basis.

 

Matti

Archived

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

×
×
  • Create New...