Password Protect Site

Does your client want to limit access to certain pages on your site? Or do you want to keep a demo catalog private? The site builder system does not allow password protection, but you can add some simple protection in with a little bit of coding.

Please note! This is not a full password system, and is not meant for creating secure sites. It is simply a way to quickly add a basic user name and password to a page. Each person will need that same user name and password to access your site pages.

  1. Create a file named 'authentication.php'.

  2. In that file, add the following code:

    
    Authorization Required
    
    

    Changing "user" to the user name you wish to use, and "pass" to the password you wish to use.*

  3. If you wish, change

    Authorization Required

    to whatever you'd like your page to read when a user clicks the 'Cancel' button. Note that this can include HTML code.

  4. Load the file into the /enc/ folder of your site.

  5. Open the index.php page in the main public_html folder.

  6. Just under the line:

    require_once("stconfig.php");

    add the following code:

    require(SB_INC_DIR ."/authentication.php");
  7. Save the index.php file.

  8. Repeat steps 5-7 above with any other pages you wish to protect (ie. affiliates.php, articles.php, catalog.php, certificates.php, contact.php, events.php, faqs.php, guestbook.php, orders.php, registry.php, search.php, sitemap.php, sitesearch.php, weblinks.php, wholesale.php).

* Use the same user name and password for each page, and give that user/password combo to any person who should have access to your system. Everyone will use the same user name and password to access the site.

Hint: For demos, change the user name and password monthly, to ensure that only those who really want to access your site can do so.