Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 11 of 11

This is a discussion on How to create basic link in OSCommerce shop in the Shared & Semi-Dedicated forum
I'm not sure if this sort of question belongs here or not but I have been unable to find an answer anywhere else so thought ...

  1. #1
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79

    How to create basic link in OSCommerce shop

    I'm not sure if this sort of question belongs here or not but I have been unable to find an answer anywhere else so thought it would be worth a try.

    I want to create a link in my OSCommerce shop like http://www.mysite.com/. The problem is that OSC uses SID's (Session ID's). When a link is normally created, the page name is added to it and then the SID. If I create the kind of link I want, the SID doesn't get attached. The result is that, if I am signed in and I click on such a link, I become signed out due to the loss of the SID.

    I've asked this question in many places on the net and no one knows of a solution. I find it hard to believe that such a link cannot be used - I can't be the first one to run across this problem. Any ideas?

    Jack

  2. #2
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,386
    OSC has an Internal Fuction

    "tep_link"

    that will put in the session info

  3. #3
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79
    Any idea where this is located? I did a search of the OSC 2.2 zip file and nothing showed up.

    Jack

  4. #4
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,386
    where the function is is no relavant.. it is in the html_output file though

    all you have to do to insert a Link is to do this

    ~~~~~~~~~~~~~~~~~

    <a href="<?php echo tep_href_link(YOUR_FILENAME, '', 'SSL OR NO SSL'); ?>" class="YOUR CLASS NAME"> YOUR TEXT </a>

    ~~~~~~~~~~~~~~~`

    you can also add the Class Info right after the "YOUR FILE NAME" between the 2 single qoutes

  5. #5
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Originally posted by OspreyServices
    OSC has an Internal Fuction

    "tep_link"

    that will put in the session info
    Originally posted by OspreyServices
    where the function is is no relavant.. it is in the html_output file though

    all you have to do to insert a Link is to do this

    ~~~~~~~~~~~~~~~~~

    <a href="<?php echo tep_href_link(YOUR_FILENAME, '', 'SSL OR NO SSL'); ?>" class="YOUR CLASS NAME"> YOUR TEXT </a>

    ~~~~~~~~~~~~~~~`

    you can also add the Class Info right after the "YOUR FILE NAME" between the 2 single qoutes
    lol

  6. #6
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79
    It's relevant if the funtion doesn't exist. You said tep_link, not tep_href_link.

    In any case that will not work. That is the function I was referring to in my original post when I said when a link is normally created by OSC. If you look at the first part of the code for this funtion it appears as
    function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
    global $request_type, $session_started, $SID;

    if (!tep_not_null($page)) {
    die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
    }
    So if the $page argument is missing, the funtion does not work. I don't want the page name to be part of the link - thus the question. In your example YOUR_FILENAME would have to be set to something like http://ww.mysite.com/index.php. I want to have it set to http://www.mysite.com.

    I am misunderstanding how to use this function?

    Jack

    Jack

  7. #7
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,386
    ohh excuse me, I did not break out the OSc Function book and make sure it was exact..

    as far as the page argument

    you do not have to use full url

    if you want the root page, just up in "/"

  8. #8
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    The reason I posted and highlighted the conflicting function names is that you can't give advice like that and not mention that "the name is something like" or "I think the name is" or some such. It doesn't do the person that you are trying to help very much good to spend a bunch of time trying to figure out how to make what you posted work when they're actually on a wild goose chase.

    I just pointed it out so that Jack would take notice of the difference.

    It also struck me as funny that you posted the proper name and either didn't notice that there was a difference of didn't care to mention it.

    It's admirable to offer help though!

  9. #9
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79
    Originally posted by OspreyServices
    ohh excuse me, I did not break out the OSc Function book and make sure it was exact..

    as far as the page argument

    you do not have to use full url

    if you want the root page, just up in "/"
    I meant no offense. You may have missed the smilie. Just pointing out why I couldn't find it.

    I appreciate your help. As I mentioned, I've asked all over the web and this is the first response I've received. What's more, it appears to work so I am very thankful. The only problem is that it does cause an extra / to be appended onto the url. So when I click on it, the url becomes http://www.mysite.com//. It doesn't seem to matter since OSC will clear that if I go to another page. However, I don't know what it will do to the SE's, if anything. Any suggestions on getting rid of the extra slash (/)?

    The code I am using is
    <?php echo '<a title="Home page" href="' . tep_href_link('/', '', 'NONSSL') . '">' . "Home" . '</a>'; ?>
    Jack

  10. #10
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,386
    no offense was taken...

    I was in a hurry when I posted my orginal Response so I did not go a look up the exact function name.

    When I responded the second time I was not in a hurry so I did look it up...

    Ron, I see your point, but if I seen someone post that, and went looking for that function and only found the other one, I would assume that to be the one they were referring to.... We are all human, we all make mistakes..


    if you have any more OSC questions ask, that is all I do for the most part is develop OSC sites...

    I am on the support forums at OSC alot too, " The_ancient " is my user name over there

  11. #11
    JPC Senior Member
    Join Date
    Jul 2004
    Posts
    79
    Ah yes, I recongize the name. Any thoughts as to the extra slash in the url? Does it cause any problems being there?

    Jack

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •