Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using ? and = in a link using tep_href_link


KennethS

Recommended Posts

Hello,

 

Here is the code I am using for the tep_href_link function:

 

'<a href="' . tep_href_link('wrapper.php?file=conditions.html') . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

 

And here is the final output URL:

http://www.equiltpatterns.com/wrapper.php/file/conditions.html

 

I am only using the Wrapper contribution as a temporary fix until I find the time to hard code around the html files themselves but this is causing a problem since I can't hold SessionID's without using tep_href_link.

 

If anyone knows of the proper formatting of this I would be grateful.

 

Thanks,

 

Kenneth S.

Kenneth S

--------------

Customer "Are you a real programmer?"

Me "No, but I did stay at a Holiday Inn Express last night"

Link to comment
Share on other sites

What is the issue? It appears that you hace SEF URL's = true so that should populate the $_GET array with $file=conditions.html

 

Let me make sure I have this correct: you set the URL as such to pass the parameters to wrapper.php. You then use the GET variables to redirect to the proper page?

 

If this is the scenario then there is nothing wrong with the code and is parsing correctly.

 

What issues are you seeing?

 

Also, try this code:

'<a href="' . tep_href_link('wrapper.php', 'file=conditions.html') . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

Link to comment
Share on other sites

Try escaping the characters - - i.e. wrapper.php\?file\=conditions.html')

 

OR

 

just change it to '<a href="wrapper.php?file=conditions.html">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

 

-jared

Link to comment
Share on other sites

Try escaping the characters - - i.e. wrapper.php\?file\=conditions.html')

 

OR

 

just change it to '<a href="wrapper.php?file=conditions.html">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

 

-jared

His recognized need is to keep the osC method of SID propogation with the tep_href_link() method. In this case, the proper format of the call to the tep method is:

tep_href_link('wrapper.php', 'file=conditions.html')

Link to comment
Share on other sites

Hello Again,

 

Chemo, tried your suggested code and it was the exact same output, it still stripped the ? and = from the URL and replaced them with /.

 

Jared, you cant escape those characters, and the bottom code you suggested would negate the SID and hence my customers would lose their cart contents, etc. when they clicked the link.

 

I'm at a loss here and am thinking this is not a very big problem which seems odd enough since all of these people add pages and links to their shops, maybe everyone should try their shop with cookies turned off ;P.

 

Thanks,

 

Kenneth S.

Kenneth S

--------------

Customer "Are you a real programmer?"

Me "No, but I did stay at a Holiday Inn Express last night"

Link to comment
Share on other sites

Here is your original output:

http://www.equiltpatterns.com/wrapper.php/file/conditions.html

The form of the URL tells me that you have SEF URL's enabled in your settings. This means that everything past wrapper.php/ is parsed as GET parameters. The result is that you will have a variable set as $file = conditions.html just as with any SEF URL generated by tep_href_link()

 

Of course, this is if you include application_top.php as your wrapper.php file. If you do not have application_top.php included in wrapper.php you'll have copy the code that extracts the SEF URL.

 

In other words, paste this at the top of the wrapper.php file:

define('SEARCH_ENGINE_FRIENDLY_URLS', 'true');
 if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
   if (strlen(getenv('PATH_INFO')) > 1) {
     $GET_array = array();
     $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
     $vars = explode('/', substr(getenv('PATH_INFO'), 1));
     for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
       if (strpos($vars[$i], '[]')) {
         $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
       } else {
         $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];
       }
       $i++;
     }

     if (sizeof($GET_array) > 0) {
       while (list($key, $value) = each($GET_array)) {
         $HTTP_GET_VARS[$key] = $value;
       }
     }
   }
 }

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...