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

    Question How to use cookie data in a <img> link...

    I have data stored in 2 cookies, "gtotal" and "ordnum",
    I need to get them into a link in an HTML page. The cookie are created in a PHP script.

    The link need to follow this pattern:

    Code:
    <img src="https://tbs.tradedoubler.com/report?organization=123&event=123&orderNumber=ordnum&orderValue=gtotal&currency=ZAR">
    thi bits in bold-italic are where the cookie data needs to be used...


    I'm a total noob, trying to get this done is wracking my brain....

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    PHP Code:
    <?php

    $cookie1
    =$_COOKIE['gtotal'];
    $cookie2=$_COOKIE['ordnum'];

    $url="<img src='https://tbs.tradedoubler.com/report?organization=123&event=123&orderNumber=".$cookie1."&orderValue=".$cookie2."&currency=ZAR' />";

    echo 
    $url;

    ?>


  •  

    Posting Permissions

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