Advice Articles

  • Beginners
    Just getting started? Loads of powerful advice here for beginners.
  • Intermediate
    Got a handle on the basics? Find more advanced topics covered here.
  • Advanced
    Warning! Advanced topics covered here.
  • Affiliate resources
    Affiliate marketing resources for affiliates and affiliate program managers tools, websites, books and articles.
  • Product reviews
    Candid reviews of the latest products to take you to the next level.


 

Affiliate Marketing Forum

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups   RegisterRegister ProfileProfile  Log in to check your private messagesPrivate Messages Log inLog in  
Using Cookies to display Clickbank affiliate's name on page

Affiliate Marketing Forum Index -> Do-It-Your-Selfers
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
IWANT



Joined: 03 Feb 2006
Posts: 9

PostPosted: Thu Feb 23, 2006 3:57 am    Post subject: Using Cookies to display Clickbank affiliate's name on page Reply with quote

I have this simple script I spent an hour and a half building. I'm redirecting from clickbank to a special offer page based on the affiliate's clickbank name and setting a cookie called "hop"

It works on my main index page, but not on other pages in the same folder?

Here's the code
Code:
<?php
if ($hop == "affiliate1")
{
   print "Affiliate Name'";
}
else if ($hop == "affiliate2")
{
   print "Affiliate Name'";
}
else
{
   print "My";
}
?>



Even odder, that code works on index.php, but if I rename it index2.php it doesn't work. It doesn't read the cookie on index2.php and act on it.

When I print the contents of the cookie on index.php I get "hop =>cbnickname". On index2.php I get array().

Is there something wrong with the way I am loading the cookie?

Here's how I load the cookie -

Code:
setcookie("hop",$_GET['hop'],time()+60*60*24*30);



That's on a different page and redirects to the sales page. The value of hop is in the URL like this .com/?hop=kickbutt, so I need to use the GET.

What's wrong here? Got to be something simple.

Thanks for your time,
Terry

[/code]
_________________
This is my signature.
Back to top View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Affiliate Marketing Forum Index -> Do-It-Your-Selfers All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum





Your host: Allan Gardyne.
Earning a good living from affiliate programs since 1998.