![]() |
More PHP help needed
I am trying to implement the CCBill ID cookie code ( like http://www.spunkycash.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']; ?> |
Check first before your setcookie if a cookie exists.
Most likely only the FIRST page they see is through POST $_POST['ccbillinput'] so on the next page they go to the POST command will be blank and you will be setting a blank cookie. |
Code:
setcookie('ccbillid', $ccbillid, $cookie_life, '/', '.69gs.com');Code:
if(!isset($_COOKIE['ccbillid'])) |
add session_start(); to each pg.
|
Quote:
|
Thanks AcidMax for the suggestion...still cant get it working. Anyone else have any ideas?
|
maybe change:
PHP Code:
PHP Code:
just a guess i didnt test it. |
Quote:
|
I didnt even notice that period, but I took it out and still same problem. Ive been trying to figrue this out for over a week now, and its the only thing left to do so I can re-launch my affiliate program.
UUUUggghhhhh :helpme |
you have that code on every page?
|
and its working fine for me i browsed from page to page, also closed my browser and came back... still good on my end
|
Quote:
Should I just have the form post to one php page instead? And if so, what code should I put in the individual pages to call that variable? |
Quote:
|
Quote:
|
Quote:
AIM - Biggle Jones ICQ - 291596343 |
THIS JUST IN.....ALKY IS THE MAN (even with his Persian mullet)
|
| All times are GMT -7. The time now is 11:52 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123