Next Previous Contents

8. Edit the countrycheck.php file

This step is very important so that it will work on your web site. You must edit the countrycheck.php file in a few locations near the start of the actual code. Load countrycheck.php into a text editor, or if you can edit through a control panel such as CPanel or VDeck, use that method if you prefer. Find the following lines:

-------- start of lines to find and edit ------------

// Edit this line to list where you have located this countrycheck.php file
// plus the notfound.php file and the badcountry.php file.
$country1_dir = "/country1/";

// Edit this line to list where you have built the htxxx.php files.
$country2_dir = "/country2/";

// Edit this to be what is most likely to be an index file on your website.
// This is used when a directory is accessed without a trailing slash.
$defindex = "index.html";

-------- end of lines to find and edit ------------

The next thing to edit is the definition for $defindex. What is the most commonly used index filename on your web site? If it's "index.html", then leave this as it is. If it's "index.php" or something else, then edit this one.

Once you've finished editing countrycheck.php, upload it to the "country1" directory on your web site if it's not already there.

If you'd like, you can also edit the two included files, "notfound.php" and "badcountry.php".

"notfound.php" is actually a very simple file containing plain html code. This is sent to the user of a "good" country when countrycheck.php cannot find the requested file on your web site.

The "badcountry.php" file is very simple. When a blocked country accesses your website, this is the file that will be sent. It has just one line of php code in it which is the "sleep()" command. It will pause for ten seconds and then send a zero byte file. The user will get a big pause and then nothing. Absolutely nothing. Everytime this user tries to access your website, there will be a ten second pause followed by a blank screen. Chances are, this person will just go away and bother someone else.


Next Previous Contents