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 located the htxxx.php files.
$country2_dir = "/country2/";

// Edit this to be what are most likely the index files on your website.
// This is used when a directory is accessed with or without a trailing slash.
// You can rearrange the order of these to speed up access. You can also
// add additional filenames.
$index_array = array(
  "index.php", "index.html", "index.htm"

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

Then on the line that contains index.php, index.html, and index.htm, you can either leave that line alone, change the order around, add more filenames, or delete any of the existing one. The filenames you use here are the most likely names used for your default index files in any of your directories. When a user tries to access your website with just a trailing slash, countrycheck.php has to find the index file and feed it to the Apache web server. The name that is used most often should be the first one in the list.

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