Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-13-2005, 02:54 PM   #1
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
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'];
?>
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-13-2005, 02:59 PM   #2
Due
Confirmed User
 
Due's Avatar
 
Industry Role:
Join Date: Mar 2001
Location: Murrieta, CA
Posts: 3,620
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.
__________________
I buy plugs
Skype: Due_Global
/Due
Due is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-13-2005, 02:59 PM   #3
AcidMax
Confirmed User
 
Join Date: May 2002
Location: MI
Posts: 1,827
Code:
setcookie('ccbillid', $ccbillid, $cookie_life, '/', '.69gs.com');
$_COOKIE["ccbillid"] = $ccbillid;
Without testing the problem could be the code above. Just try setting it on one page, and then just checking to see if it exists.

Code:
if(!isset($_COOKIE['ccbillid']))
{
   setcookie(...);
}

echo $_COOKIE['ccbillid'];
__________________
Latest MMA news. http://www.mmawrapup.com
AcidMax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-13-2005, 03:02 PM   #4
MickeyG
Confirmed User
 
Join Date: May 2004
Location: South Florida
Posts: 4,134
add session_start(); to each pg.
MickeyG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-13-2005, 03:06 PM   #5
AcidMax
Confirmed User
 
Join Date: May 2002
Location: MI
Posts: 1,827
Quote:
Originally Posted by MickeyG
add session_start(); to each pg.
He is not setting a session variable.
__________________
Latest MMA news. http://www.mmawrapup.com
AcidMax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:11 PM   #6
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
Thanks AcidMax for the suggestion...still cant get it working. Anyone else have any ideas?
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:14 PM   #7
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
maybe change:
PHP Code:
setcookie('ccbillid'$ccbillid$cookie_life'/''.69gs.com'); 
to:
PHP Code:
setcookie('ccbillid'$ccbillid$cookie_life'/''69gs.com'); 
that period in the domain might be throwing it off

just a guess i didnt test it.
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:15 PM   #8
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
Quote:
Originally Posted by MickeyG
add session_start(); to each pg.
and don't do this.
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:18 PM   #9
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
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
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:19 PM   #10
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
you have that code on every page?
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:21 PM   #11
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
and its working fine for me i browsed from page to page, also closed my browser and came back... still good on my end
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:22 PM   #12
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
Quote:
Originally Posted by Alky
you have that code on every page?
yea....Im just having the form post to whatever page they are on.

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?
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:23 PM   #13
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
Quote:
Originally Posted by Alky
and its working fine for me i browsed from page to page, also closed my browser and came back... still good on my end
hmmm....am I calling it wrong? <? print $ccbilloutput; ?>
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:24 PM   #14
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
Quote:
Originally Posted by BiggleJones
yea....Im just having the form post to whatever page they are on.

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?
if you do it this way, you will need to check if $_POST['ccbillinput'] is set, otherwise it is going to run your setcookie every time
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 06:26 PM   #15
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
Quote:
Originally Posted by Alky
if you do it this way, you will need to check if $_POST['ccbillinput'] is set, otherwise it is going to run your setcookie every time
Got ICQ or AIM?

AIM - Biggle Jones

ICQ - 291596343
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-14-2005, 07:00 PM   #16
BiggleJones
Confirmed User
 
BiggleJones's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Downtown LA
Posts: 2,276
THIS JUST IN.....ALKY IS THE MAN (even with his Persian mullet)
__________________
ICQ-291.596.343
BiggleJones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.