Documentation

Frontdesk Installation, Setup, and Use

Getting Started

Overview

In this section, you'll learn...

Before you begin

Here are a couple of important notes before going further:

  1. Every directory with a Frontdesk related page inside should also contain a copy of helper.php. You can find a copy of helper.php in the /frontdesk/site folder on your desktop.
  2. You might notice that all Frontdesk pages end with .php (register_members.php, login_members.php, etc.). If the pages you want to password protect don't already end with .php, here's how to make them work just like PHP pages:

    Check the folder on your web server where your password protected pages will be located for a file named .htaccess.

    If there is no .htaccess file in the folder, copy the one from the /frontdesk/site on your desktop into the folder.

    If a .htaccess file is already there, add the lines below to the bottom of the file:

    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .htm .html
    

    Now any .html or .htm you use with Frontdesk will be treated just like PHP files.

Getting started

Following are the first steps to take in securing Frontdesk and setting up a simple members area.

  1. Change the control panel password.

    To do so, log in the control panel and navigate to the "Settings" page. Click the "Profile" link and enter a new password.

  2. Copy the sample login form to create your own.

    Copy /frontdesk/site/login_members.php to the same directory your site's home page is located.

    Update the check_token line near the top of the file: Change the URL between the quotes so that it points to the page you will password protect.

    There are two "hidden" form fields on the login form that should be updated now that you've copied the page to a different location: url_to_this_page and url_to_response.

    Change the url_to_this_page value to the URL to the login form. Change url_to_response to the URL to the page you will password protect.

  3. Copy the sample registration form to create your own.

    Copy /frontdesk/site/register_members.php to the same directory your site's home page is located.

    As with the login form, there are two "hidden" form fields on the registration form that should be updated now that you've copied the page to a different location: url_to_this_page and url_to_response.

    Change the url_to_this_page value to the URL to the registration page. Change url_to_response to the URL to the login form.

  4. Password protect a page.

    Open the page you want to secure in the text editor of your choice (e.g., Notepad or TextEdit). Copy and paste the code below to the top of the page, before any other code.

    <?php
    $action = 'ss';
    require $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
    check_signed_in('URL TO LOGIN FORM GOES HERE');
    ?>
    

    Take note of the check_signed_in line above. Enter the URL to the login form you created between the quotes on that line.

  5. Copy the sample logout page to create your own.

    Copy /frontdesk/site/members/logout.php to the same directory as your protected page. You may now add a link to the logout page anywhere on your password protected page.

  6. Copy the sample profile page to create your own.

    Copy /frontdesk/site/members/profile.php to the same directory as your protected page. You may add a link to the profile page anywhere on your password protected page.

    Change the URL on the check_signed_in line near the top of the page so that it points to your login page.

    Finally, change the url_to_this_page and url_to_response form field values to the URL to the profile page.

  7. You're done. You've password protected a page and set up a registration form so users can sign up for access. You've also created a login form and set up a profile page members can use to update their account information.