PDA

View Full Version : in.php and php redirect...


cmedia
14th July 2009, 11:33 PM
Hello,

in a my site, the in.php can't be included in the home, because the stupid script i use in this domain, load plenty of time trough htaccess the index, so cjoverkill count many false hits and work very bad, i guess to solve this asking the trade sites to send traffic not to the main url, but in a sub directory, with htaccess disabled, so the in.php will work "normal".

Then in the php file iwant to use this code:

<?php

include ("../in.php");

header( 'Location: http://www.videotubehard.com/' ) ;

?>

This will work fine or cjoverkill don't "like" redirect in page with in.php include?

Best Regards.

ICEFIRE
14th July 2009, 11:57 PM
Try this instead of the in.php include:


<?php
$cookietime=600;
$cj_in_cookie=$_COOKIES["cj_in_cookie"];
if (!isset($cj_in_cookie) || $cj_in_cookie==""){
setcookie ("cj_in_cookie",time(),"1",time()+($cookietime*1));
include ("../in.php");
}
?>


This wil basically set a 10 minutes (600 seconds) cookie when including the in.php. If the surfer has already loaded the in.php powered file in less than 10 minutes ago, the in.php will not be included again.

cmedia
21st July 2009, 05:17 PM
Try this instead of the in.php include:


<?php
$cookietime=600;
$cj_in_cookie=$_COOKIES["cj_in_cookie"];
if (!isset($cj_in_cookie) || $cj_in_cookie==""){
setcookie ("cj_in_cookie",time(),"1",time()+($cookietime*1));
include ("../in.php");
}
?>


This wil basically set a 10 minutes (600 seconds) cookie when including the in.php. If the surfer has already loaded the in.php powered file in less than 10 minutes ago, the in.php will not be included again.

Interesting...

This will reduce also the server load?

Best Regards.

ICEFIRE
22nd July 2009, 01:14 AM
It will set a cookie to every new visitor and if they load another pageit will just skip the in.php include. In that case it will reduce the server load a bit, but its nothing you should notice.

cmedia
24th July 2009, 01:30 AM
It will set a cookie to every new visitor and if they load another pageit will just skip the in.php include. In that case it will reduce the server load a bit, but its nothing you should notice.

Ok, thank you very much, you helpful as usual!

Xeandrac
16th August 2009, 07:52 PM
does the cookie affects incomming hits on other cjo users in your trade db?

Greetz,

X

ICEFIRE
16th August 2009, 11:57 PM
does the cookie affects incomming hits on other cjo users in your trade db?

Greetz,

X

CjOverkill doesn't use cookies for tracking, that code example is just a different in.php include mainly targeted for multipage sites, but also can be used on single page sites that rely on htaccess rewriting.

As for affecting counters, some raws will not be counted because of the in.php include skip if the surfer is already cookied. All uniques will be coutned correctly, so the trade formulas themselves will not get affected and your real traffic will always be counted properly.