cookie stuck

neilparnham

Junior Member
Joined
Mar 3, 2008
Messages
117
Reaction score
13
hi, just after a little bit of help, im not a programmer, yet , just wondering if someone knew in regards to the folllowing:

Code:
<?
$random_number = rand(1,4);
if($random_number == 1){
echo "Our cookie stuffing code goes here!";     
}
?>

i want to combine that with

Code:
RewriteEngine On
RewriteRule tracking_pixel.jpg http://www.affiliate.com/BDHDHDHDJ/ [R,L]

so that i can have my affiliate coding and makes it so i dont get high ctr, i tried putting the second lot of coding where it says our cookie stuffing goes here but it dont work, well im not a programmer so i wont know, thanks for any help, cheers neil.:)
 
the first ones says ... choose a random number between 1 and 4
If 1 run the cookiestuffer code

The second code goes into your htaccess file ... means when including the img src="tracking_pixel.jpg" .. then load the aff side in the background instead of loading the image.

the text you need to put into part one is
Code:
<img src="tracking_pixel.jpg" border="0" width="0px" />
 
If you have further question let me know, i am glad to help ;-)
 
hmmm i just figured out that i can not edit my previous post ... well however for the others tha thave the same problem as Neil does, here is the Cookiestuffer code that works with the randomizer and htaccess file:

Basically it is just the php code like:
Code:
<?
$random_number = rand(1,4);
if($random_number == 1){
echo "<img src='tracking_pixel.jpg' border='0' width='0px' />";     
}
?>

in the hataccess you will have the following:
Code:
RewriteEngine On
RewriteRule tracking_pixel.jpg http://www.affiliate.com/BDHDHDHDJ/ [R,L]

However i would suggest that you insert the htaccess into a subflder called images. so the htaccess code is still the same but now the htaccess file is located into a subfolder called images. if you have done so change the first code to:

Code:
<?
$random_number = rand(1,4);
if($random_number == 1){
echo "<img src='img/tracking_pixel.jpg' border='0' width='0px' />";     
}
?>

where img is the subfolder your htaccess file is in.

P.S. The File that you put the php code on needs to be *php file ;-)
If you want this code to work with html also you additionally need to put the following code into your htaccess file:

Code:
AddHandler application/x-httpd-php .html .htm .php

or the following one in case your server uses php5 already

Code:
AddHandler application/x-httpd-php5 .html .htm .php

cheers
catman
 
Back
Top