Jump to content
New Reality: Ads For Members ×

append links with current dynamic url


toolman

Recommended Posts

Hi,

 

I have a URL which pulls through some dynamic items, for example:

http://www.website.com/page.shtml?code=home&ref=ref1&utm_source=direct&utm_medium=email&utm_campaign=weekly

The ref=ref1 is a cookie, but I have an issue when going off that page and visiting another. The cookie somehow gets reset and results in it becoming undefined.

What I would like to do is to append two links on the page with

page2.shtml?code=home&ref=ref1&utm_source=direct&utm_medium=email&utm_campaign=weekly

and

page3.shtml?code=home&ref=ref1&utm_source=direct&utm_medium=email&utm_campaign=weekly

so that the links will carry through the ref= and other items.

I have read that I can use 'document.location.search', but I'm not sure how to do this, or if I can use jQuery either.

Any ideas on how I can do this?

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/297748-append-links-with-current-dynamic-url/
Share on other sites

Archived

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



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.