Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2013
    Thanked 0 Times in 0 Posts

    Exclamation Please help, how do i embed a discount code into a link?

    Please help, how do i embed a discount code into a link? i am trying to add a discount code into a link on my site so people will get a discount from another site when clicking it. I am guessing this is easy to do but i have no idea.

    Any help would be really appreciated.


  • #2
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    The Pleiades
    Thanked 28 Times in 28 Posts
    Good afternoon Robert,

    In your link instead of creating a basic link like 'index.html', you can add the discount code into the link by concatenating it onto the end of the link value via an ampersand.

    If the voucher code never changes, you can hardcode this into the link. Let's say the discount code is Xp91dMe, you could do:
    <a href='index.html&code=Xp91dMe'>Click here for a discount!</a>
    Then, whatever page that directs to, you will need to use a serverside language to process the link (i.e - make sure the discount code in the URL matches the actual discount code), then you can decide what to do from there depending on the value.

    Are you doing something similar to affiliate marketing?

    Hopefully someone else can add to my advice!

    Kind regards,


  • #3
    New Coder
    Join Date
    May 2009
    Thanked 3 Times in 3 Posts
    Like LearningCoder stated, you'll need to create a query string based on the Vendor's requirements. The Vendor might have a parameter of "coupon-code" where they provide you a dedicated code for your business.

    Link: http:www.vendor.com&parameter=12345
    Parameter: They supply the parameter.
    12345= The value for that parameter given to you so you get credit.


    Posting Permissions

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