Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I really need some help with linking


lindsayanng

Recommended Posts

Posted

The ONE thing i CONSTANTLY struggle with in this whole php thing is using the tep_ tags> i dont really GET IT.

 

So i am working on image mapping, but i need to change the hard coded links into php tep links.

 

here is the code i have

<area shape="rect" coords="265,160,392,191" href="../landscapes/landscapes.htm">

 

If someone can just show my how to link this file the CORRECT way, i would be FOREVER greatful/

 

The file is located in the root/landscapes/landscapes.html

 

So far, i went to the filenames.php page and then entered

 

define('FILENAME_LANDSCAPES' , 'landscapes.html');

 

Do i NEED to tell it that it is in the landscapes folder? Or will it know. I always thought i would have to do soemthing like

define('FILENAME_LANDSCAPES' , '/landscapes/landscapes.html');

 

ANY help is GREATLY appreciated. I feel like once someone explains this to me, i will get it for good. I'm a pretty quick learner.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted
Do i NEED to tell it that it is in the landscapes folder? Or will it know. I always thought i would have to do soemthing like

define('FILENAME_LANDSCAPES' , '/landscapes/landscapes.html');

 

You need to enter a full qualified path from the script which contains the "define" statement, leading to landscapes.html. the actual pathe depends on your webspace's layout, so you'd rather post a little more details here:

 

* Down from the webroot, where is your script installed?

* Which path is landscapes.html in?

Posted

the catalog is installed in root/catalog

 

the landscapes (as i said above) is in root/landscapes/landscapes.html

 

so what i need to figure out is how to link to a file in a folder outside of the catalog, a folder inside and catalog, and a folder inside the root.

 

when you say i need to define the absolute path, i understand WHAT you are saying, but going off of what is already there, it doesnt make ANY sense because a LOT of the files in the filenames.php (where the files are defined) do not say ../catalog/myfile.php - they just say myfile.php

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

lindsayanng,

All your programs are relative to catalog...because catalog is being set in the configure.php...

I hope this helps

dittone

Posted

nope. actually it didnt help at all. I REALLY would just like someone to tell me HOW once, and it will sink in forever. I just cant figure it out.

 

IS there a way to use the tep_ref_link for links from teh catatlog and into the root, and visa versa.. and also, do i need to give the file path in the filenames file? Because they arent there in the ones that are already there.

 

Can someone PELASE give me a hand with this.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

anyone?

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

but i THOUGHT that using the tep_href function would keep the session, so if people were shopping, and the clicked out of oscommerce, and then came back to it, they would be ok,. Is this not the case?

 

I have been trying to get these answers for a while and have been given soo many different ones

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

anyone??

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

This answer is a bit long, so bear with me.

 

includes.php has two relevant pieces here: One of them sets the cookie domain, one of them sets the cookie path.

 

Here's how it works:

A web server (any web server) that executes code that sets a cookie has to specify to the browser a domain (i.e. http://www.mydomain.com or http://yourdomain.com) and a path (i.e. /forums or /scripts/gallery1).

 

Let's say that you have some forum software installed at http://yourdomain.com/forum and some gallery software installed at http://yourdomain/scripts/gallery1. When the forum software sends your browser a cookie, it should send it for the domain of yourdomain.com and the path of /forum. After the browser receives the set-cookie command with a domain of yourdomain.com and a path of /forum, the browser will know send that cookie along with all future requests in the current browsing session, provided you're requesting something at http://yourdomain.com/forum . You can browse to Google, Yahoo, Dictionary.com, etc. So long as you don't close the browser, or logout of the forum, then the session cookie for the forum is kept in your browser cache. The browser will send it along with any future requests to http://yourdomain.com/forum; in that browser session (so long as the browser is kept open).

 

When you browse to http://yourdomain.com/scripts/gallery1 your browser does NOT send the cookie (yet) because even though the domain matches, the path doesn't match. The gallery software can send a different cookie, specifying a domain of yourdomain.com and a path of /scripts/gallery1 and the browser will know to send the 2nd cookie to only http://yourdomain.com/scripts/gallery1. In this way, the forum maintains its own cookie (could be a logged in session) and the gallery maintains its own cookie, completely independent from each other. Imagine what would happen if the forum cookie were sent to the gallery software -- it would get rejected.

 

So, back to osCommerce. It sends a cookie to the browser, also specifying a domain and a path. This cookie domain and cookie path are specified in includes.php.

 

Now, back to your website's links that are "external" to osCommerce. It shouldn't really matter. You shouldn't have to do anything special at all.

 

So, I have a question. Is there a problem you were seeing that you're trying to correct, or just a future problem you're thinking might happen if you don't plan for it?

 

 

anyone??
Posted

thanks so much for that explaination. I'm sorry if this sounds snotty, its not meant to, but i already knew most of that. I understand how cookies work and what they do.

 

 

I need to know two things, the first is specific.

how do i turn this into a php code with tep_href_link ?

<area shape="rect" coords="265,160,392,191" href="../landscapes/landscapes.htm">

 

and finally.. what i am TRYING to figure out is how can I keep a session ID when a person goes from the catalog to the portfolio and back again. The website is bscphoto.com and bscphoto.com/catalog.

 

i DO know that i should be using the tep_href style of linking, and according to what you say, i need to tell EVERY page to use the same cookie?

 

also, when i define a filename that is in the root and not the catalog folder, how do i tell the website that it is in the root? I mean, ALL of the defines in teh stock oscomemrce do not show a filepath> Is there some code that is telling it that ALL files will be located in the catalog? if so, how to I make this so that it looks in the root first?

 

I CAN NOT be the first person who wanted to do this, am i??

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

I think what Jared (who posted under my username) was saying is the session_id will be stored without using a tep_href. The only reason the session id would not be there is if the browser session were closed. Just like if you had one site going in your browser and then opened another tab to a different website and poked around there for a while. When you came back (without a huge amount of time having passed) your session_id would still be on the site.

 

I haven't worked on a site where when you clicked gallery (therefore different path and path id) then back to site where you were not still logged in. Maybe that is uncommon... i dunno.

Posted

ohh i thought he was saying that a different cookie gets stored from different parts of the site. So if i told teh gallery to store a cookie, it would, but it woudl not be the same info as the shopping cart cookie..

 

wow, i am more confused than i thought i was. I thought you NEEDED to carry the session ID in order to keep the cart information. or is that only for customers who do not accept cookies?

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

  • 1 month later...
Posted
ohh i thought he was saying that a different cookie gets stored from different parts of the site. So if i told teh gallery to store a cookie, it would, but it woudl not be the same info as the shopping cart cookie..

 

wow, i am more confused than i thought i was. I thought you NEEDED to carry the session ID in order to keep the cart information. or is that only for customers who do not accept cookies?

Hi Lindsay,

 

I've been struggling with this too.

 

With no offense intended for the posters who've been helping so far, I think you're getting incomplete information.

 

For instance, it's true that that a logged in user will be able to leave the site (or just the cart) and come back in a reasonable time frame with the same browser and find themselves still logged in.

 

However, by my experience, a non-logged in user who places something in their cart and then clicks a link that doesn't contain the session ID, will not be able to come back to the cart and have the item still in their cart (unless they use their back button). The session ID associated with the item they placed in their cart will be lost and they'll have to add the item again.

 

For my purposes, I've done exactly what you're referring to, which is to define the filename in filenames.php, just as you described. However, to get it to work for pages above the cart level, I've just resorted to plain old directory navigation for links in the definition. This is an example of what I used:

define('FILENAME_HERE', '../file-for-link.php');

This works perfectly well in browsers, although the links look odd if you view the source on one of the pages. They'll contain yourdomain.com/cart/../file-for-link.php, but as I said, they work perfectly well.

 

I've set up an entire site to allow seamless moving between cart and non-cart pages while maintaining the session IDs, so if you need any tips I may be able to help.

Archived

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

×
×
  • Create New...