Documentation
Frontdesk Installation, Setup, and Use
Getting Started
Overview
In this section, you'll learn...
- How to work with non-PHP pages
- How to create registration and login forms
- How to password protect pages for your members area
Before you begin
Here are a couple of important notes before going further:
- Every directory with a Frontdesk related page inside should also contain a copy of
helper.php. You can find a copy ofhelper.phpin the/frontdesk/sitefolder on your desktop. -
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
.htaccessfile in the folder, copy the one from the/frontdesk/siteon your desktop into the folder.If a
.htaccessfile 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.
-
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.
-
Copy the sample login form to create your own.
Copy
/frontdesk/site/login_members.phpto the same directory your site's home page is located.Update the
check_tokenline 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_pageandurl_to_response.Change the
url_to_this_pagevalue to the URL to the login form. Changeurl_to_responseto the URL to the page you will password protect. -
Copy the sample registration form to create your own.
Copy
/frontdesk/site/register_members.phpto 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_pageandurl_to_response.Change the
url_to_this_pagevalue to the URL to the registration page. Changeurl_to_responseto the URL to the login form. -
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_inline above. Enter the URL to the login form you created between the quotes on that line. -
Copy the sample logout page to create your own.
Copy
/frontdesk/site/members/logout.phpto the same directory as your protected page. You may now add a link to the logout page anywhere on your password protected page. -
Copy the sample profile page to create your own.
Copy
/frontdesk/site/members/profile.phpto 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_inline near the top of the page so that it points to your login page.Finally, change the
url_to_this_pageandurl_to_responseform field values to the URL to the profile page. - 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.