User Tools

Site Tools

Translations of this page:


Documentation index



PHP Includes

Some people include files like






moreover they use it may times per page.

You should NOT use it.


PHP creates page BEFORE user gets it. So if you have something like include('http://otherdomain/1.html') PHP has to load that page each time user load a page with that include.

There 2 downsides of this approach:

  • PHP create a regular connection to that host requesting a page. If you have 10 such includes - 1 request to such page generates 10 subrequests loading server.
  • If for some reason PHP won't be able to connect to that domain and load that page - it will wait and first page won't be loaded until PHP gets that include. So if that otherdomain is down - first domain will be virtually down too.

What to do:

Use only local includes. Ie virtual('/scj/top/top.html') should be include('/home/user/domain/scj/top/top.html');

if file is located at another server - ask admin to setup rsync or copy file using crontab and so on.

Including local script with parameters

Let's say you have include like


so you have some parameters here. You can pass it as

$_GET['x'] = 3;
$_GET['y'] = 2;

Close site for some countries

Example for .htaccess

RewriteEngine on
RewriteRule ^$ [R,L]

Count productivity from feeders

There's a common task how to select feed traders (let's say when you buy traffic at at a traffic exchange) based on it's productivity.

The easiest way is to switch on the option “add notrade as feed traders” in Cj settings - Processed Data. Thus the script will add all new referers as traders and you will be able to see all the stats for each domain you get traffic from.

hints.txt · Last modified: 2016/03/27 17:11 by admin