Cookie Password Protection version 1.1 + Shareware version of File Protection 1.0

Type of script: PHP
Version: v1.1
Cost: Free (File Protection v 1.0 is shareware)
Support: Yes

How to install

  1. Open settings.php in your favourite text editor (I use WordPad).
  2. Change all user names and passwords to the ones you would like to use. If you need help adding more passwords, please read How to add more users.
  3. Edit login.php, logout.php and invalidlogin.php so that they look like the rest of your web site. Don't remove any <? ?> tags.
  4. Add this line at the top of the pages you would like to protect:
    <? include("protection.php"); ?>
    If you want to protect your download files you should have a look at file protection below.
  5. Upload everything to your web site.
  6. WARNING: Don't link to the login.php file, always link to the file you want to protect! If you add a link directly to login.php the script may not work at all.
  7. If you need more help, visit our online support forum at forum.xaviermedia.com.

How to use file protection version 1.0

  1. When you have installed Cookie Password Protection on your pages you can also try File Protection version 1.0. Remember that the maximum file size for the files you're protecting is 10Kb. If you need to protect larger files, you should upgrade to Cookie Password Protection 2.6.
  2. Open settings.php and change $hiddendirectory to the full path to the directory where you have your files.
  3. Instead of linking directly to your downloadable files, you replace all direct links with this code:
    <A HREF="<? echo fileprotect("filename.zip",0); ?>">Text</A>
    The code above will create a link to filename.zip that will only work for 15 minutes, after that the visitor will see the invalid login page and have to login again.
  4. If you have an image site you can protect your images like this:
    <IMG SRC="<? echo fileprotect("filename.jpg",0); ?>">
    This will display the picture filename.jpg, but if the user copy the URL and put it on his own web site the link will expire after 15 minutes and no picture will appear (instead the user will only see a broken image).

How to create a logout link
Create a link that looks like this
<A HREF="<? echo $PHP_SELF ?>?action=logout">Logout</A>
Add the link somewhere on a protected page. It's very important that the link is on a page that have <? include("protection.php") ?> at the top, otherwise the logout link will not work.
WARNING: Never link directly to logout.php, that will NOT log out the user and the script may not work at all!
If you need more help, visit our online support forum at forum.xaviermedia.com.

© Copyright Xavier Media Group.
All rights reserved.
Need help? Visit forum.xaviermedia.com