PHP Cookie / Variable Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BiggleJones
    Confirmed User
    • Dec 2002
    • 2276

    #1

    PHP Cookie / Variable Help

    I am trying to implement the CCBill ID cookie code ( like http://www.felixflow.com/ ) into my affiliate site. I have the code working on individual pages, but the variable/cookie clears everytime I switch pages. Any help on this would be awesome and thanks in advance:

    <?
    $ccbillid = "".$_POST['ccbillinput']."";
    $cookie_life = time() + 31536000;
    setcookie('ccbillid', $ccbillid, $cookie_life, '/', '.69gs.com');
    $_COOKIE["ccbillid"] = $ccbillid;

    if (!$_COOKIE["ccbillid"]){$ccbilloutput = "XXXXXX"; }
    else {$ccbilloutput = $_COOKIE["ccbillid"]; }

    if(isset($_COOKIE['ccbillinput'])) $ccbillid = $_COOKIE['ccbillinput'];
    if(isset($_POST['ccbillinput'])) $ccbillid = $_POST['ccbillinput'];
    ?>

  • Lace
    Too lazy to set a custom title
    • Mar 2004
    • 16116

    #2
    bump.
    Your Paysite Partner
    Strength In Numbers!
    StickyDollars | RadicalCash | KennysPennies | HomegrownCash

    Comment

    • calmlikeabomb
      Confirmed User
      • May 2004
      • 1323

      #3
      Never worked with ccbill cookies before. Are you inserting this code on every page? If so try it like this....

      Code:
      <?
      
      if(isset($_POST[ccbillinput])){
      $ccbillid = $_POST[ccbillinput];
      $cookie_life = time() + 31536000;
      setcookie('ccbillid', $ccbillid, $cookie_life, '/', '.69gs.com');
      
      if (!isset($_COOKIE['ccbillid'])){$ccbilloutput = "XXXXXX"; }
      else {$ccbilloutput = $_COOKIE['ccbillid']; }
      
      if(isset($_COOKIE['ccbillid'])) {$ccbillid = $_COOKIE['ccbillid'];}
      if(isset($_POST['ccbillinput'])) {$ccbillid = $_POST['ccbillinput'];}
      ?>
      Just a guess....hope it helps.
      Last edited by calmlikeabomb; 07-13-2005, 04:11 PM.
      subarus.

      Comment

      Working...