You are here:  » Jump link for custom URL

Support Forum



Jump link for custom URL

Submitted by chrisst1 on Thu, 2012-11-01 11:20 in

Morning David

I'm using custom URL's to link users to merchants homepages, I can get the URL's from the custom DB field to our pages and produce working links ok, but how can I get those URL's to function the same as the feed links using jump.php. Is that possible to do?

Chris

Submitted by support on Thu, 2012-11-01 11:35

Hi Chris,

It's straight forward to add "generic" functionality to jump.php so that you can pass it a URL rather than a product id. I always recommend base64_encoding URLs when including in a URL itself to avoid any problems.

Firstly, add the following to the top of jump.php, just after the opening PHP tag:

  if (isset($_GET["url"]))
  {
    $url = base64_decode($_GET["url"]);
    header("Location: ".$url);
    exit();
  }

Now to generate your links, let's say you've extracted your URL from your custom table into the variable $url, and you have something like:

  print "<a href='".$url."'>Go to store</a>";

...to send that via jump.php, you would use:

  print "<a href='".$config_baseHREF."jump.php?url=".base64_encode($url)."'>Go to store</a>";

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by chrisst1 on Mon, 2012-11-05 13:48

Thanks David

That did the job (after I put the ; on the end of header line) :)

Chris

Submitted by support on Mon, 2012-11-05 14:50

Ooops, thanks - corrected above!

Cheers,
David.
--
PriceTapestry.com