Documentation

Frontdesk Installation, Setup, and Use

Member Pages

Overview

The member pages are all the pages your members see - They're the registration and login forms, and password protected pages your members interact with on your site.

The member pages are located in the /frontdesk/site folder on your web server:

http://example.com/frontdesk/site/register_members.php
http://example.com/frontdesk/site/register_members_email.php
http://example.com/frontdesk/site/register_paypal_onetime.php
http://example.com/frontdesk/site/register_paypal_subscription.php

http://example.com/frontdesk/site/find_password.php

http://example.com/frontdesk/site/login_members.php
http://example.com/frontdesk/site/login_members_email.php

http://example.com/frontdesk/site/members/index.php
http://example.com/frontdesk/site/members/logout.php
http://example.com/frontdesk/site/members/profile.php

Note: Pages with the word "client" in their name are discussed in the "Client Pages" section below.

Registration

You can create accounts for members from the control panel, or they can make their own using one of your registration forms.

Following are fields that must be included on every registration form:

<form method="post" action="/frontdesk/app/frontdesk.php">
Username<br />
<input type="text" name="username" value="" /><br />
Password<br />
<input type="password" name="password_1" /><br />
Re-enter password<br />
<input type="password" name="password_2" /><br />
<input type="hidden" name="url_to_this_page" value="URL GOES HERE" />
<input type="hidden" name="url_to_response" value="URL GOES HERE" />
<input type="hidden" name="a" value="aam" />
<input type="submit" value="Create my account" />
</form>

All the registration form field options follow:

a
Type: hidden
This is the action the form performs. Always set it to "aam" for regular registration forms; set it to "pps" for PayPal forms.
allow_renewals
Type: hidden
Set this field to "yes" if you want members to be able to renew their account.
custom_0x
Type: hidden or text
Use custom fields (e.g., custom_01, custom_02, custom_03, ..., custom_20) to collect and store additional account information.
days
Type: hidden
Number of days accounts should remain active
email
Type: text
Email address
password_1
Type: password
Users enter their password here.
password_2
Type: password
Users enter their password again to confirm it.
register_with_email
Type: hidden
Set this to "yes" if you want members to log in with their email address instead of a username. Leave the "username" field off your registration form.
required
Type: hidden
Enter the fields you want users to always fill in; separate them with a comma. An example: Set this to "name, email" to require users to provide their name and email address.
subscriber
Type: checkbox or hidden
Set this field to "yes". Use it to let users subscribe to the emails you send from the "Email Members" page in the control panel.
url_to_response
Type: hidden
Enter the URL of the page you want members sent to after they complete the form.
url_to_this_page
Type: hidden
Enter the URL of the registration form so Frontdesk can re-display it if an error occurs.
username
Type: text
The username the user wants to... use

Find Password

If a member forgets their password, they can find it using your "find password" form. Members enter the email address they signed up with on the form and Frontdesk emails them their password.

Always add the fields below to the top of the page your "find password" form is on:

<?php
$action = 'ss';
require_once $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
extract(get_response());
?>

Here's the code for "find password" form:

<form method="post" action="/frontdesk/app/frontdesk.php">
Email<br />
<input type="text" name="email" value="" /><br />
<input type="hidden" name="url_to_this_page" value="URL GOES HERE" />
<input type="hidden" name="url_to_response" value="URL GOES HERE" />
<input type="hidden" name="a" value="fp" />
<input type="submit" value="Send my password" />
</form>

The field definitions follow:

a
Type: hidden
This is the action the form performs. Set it to "fp".
email
Type: text
Members enter the email address associated with their account.
url_to_response
Type: hidden
Enter the URL of the page you want members sent to after they complete the form.
url_to_this_page
Type: hidden
Enter the URL of the "find password" form so Frontdesk can re-display it if an error occurs.

Login

Members use your login form to gain access to your password protected pages.

Always add the following lines to the top of the page your login form is on:

<?php
$action = 'ss';
require_once $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
check_token('URL TO MEMBERS HOME PAGE GOES HERE');
extract(get_response());
?>

Take note of the line that begins with check_token. Enter the URL of the page members should be sent to if they're already signed in. Place the URL between the quotes on the "check_token" line.

Here's a sample login form:

<form method="post" action="/frontdesk/app/frontdesk.php">
Username<br />
<input type="text" name="username" value="" /><br />
Password<br />
<input type="text" name="password" value="" /><br />
<input type="hidden" name="url_to_this_page" value="URL GOES HERE" />
<input type="hidden" name="url_to_response" value="URL GOES HERE" />
<input type="hidden" name="a" value="sim" />
<input type="submit" value="Sign in" />
</form>

Here are all the login form field possibilities:

a
Type: hidden
This is the action the form performs. Set it to "sim".
email
Type: text
The member's email address. Only add this field to your form if you set up your registration form to allow users to register with their email address via the register_with_email field. The sign_in_with_email field below is also required.
password
Type: password
The member's password
remember_me
Type: checkbox
Set this to "yes" to allow members to remain logged in indefinitely on the computer they're using.
sign_in_with_email
Type: hidden
When set to "yes", members can sign in with their email address. Replace the "username" field on your form with the "email" field above.
url_to_response
Type: hidden
Enter the URL of the page you want members sent to after they log in.
url_to_this_page
Type: hidden
Enter the URL of the login form so Frontdesk can re-display it if an error occurs.
username
Type: text
The member's username

Index

The index page in the demo members directory (index.php) acts as the password protected area's home page. It's the page members land on each time they log in.

You can include whatever you like on your password protected pages, however the following should appear at the top of all them:

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

Take note of the check_signed_in line. Enter the URL of the login page members should be redirected to if they're not signed in. Place the URL between the quotes on the "check_singed_in" line.

You can display members' information from the database by adding the following line to your password protected pages, after the check_singed_in line:

extract(get_profile());

After adding the line, you can show the user's username or any other information from the database on the page you're working with. Here's an example:

Welcome, <?php echo $username; ?>!

Frontdesk will automatically replace $username the member's username:

Welcome, jenni!

Following are all the database field names you can use:

Profile

Members can view and update their account information from the profile page.

Copy and paste the the code below to the top of any profile page you create:

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

Pay special attention to the check_signed_in line. Enter the URL of the login page members should be redirected to if they aren't signed in. Place the URL between the quotes on the check_signed_in line.

An example profile form:

<form method="post" action="/frontdesk/app/frontdesk.php">
Name<br />
<input type="text" name="name" value="" /><br />
Email<br />
<input type="text" name="email" value="" /><br />
Username<br />
<input type="text" name="username" value="" /><br />
New password<br />
<input type="password" name="password_1" /><br />
Re-enter new password<br />
<input type="password" name="password_2" /><br />
<input type="hidden" name="required" value="username, name, email" />
<input type="hidden" name="url_to_this_page" value="URL GOES HERE" />
<input type="hidden" name="url_to_response" value="URL GOES HERE" />
<input type="hidden" name="a" value="ep" />
<input type="submit" value="Save changes" />
</form>

All the profile form field options follow:

a
Type: hidden
This is the action the form performs. Always set it to "ep".
custom_0x
Type: hidden or text
Use custom fields (e.g., custom_01, custom_02, custom_03, ..., custom_20) to collect and store additional account information.
email
Type: text
Email address
password_1
Type: password
Users enter a password here to change their current password.
password_2
Type: password
Users re-enter their new password to confirm it.
required
Type: hidden
Enter the fields you want users to always fill in; separate them with a comma. An example: Set this to "name, email" to require users to provide their name and email address.
subscriber
Type: checkbox
Set this field to "yes". Use it to let users subscribe or unsubscribe from the emails you send from the "Email Members" page in the control panel.
url_to_response
Type: hidden
Enter the URL of the page you want members sent to after they update their profile.
url_to_this_page
Type: hidden
Enter the URL of the profile page so Frontdesk can re-display it if an error occurs.
username
Type: text
The member's username. If you include this field on your profile form, always include it in the "required" fields list.

Sign out

When members click on to your "sign out" page, their session ends and they can no longer access the members area.

Paste the following code to the top of any logout page you create:

<?php
$action = 'ss';
require_once $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
sign_out('/frontdesk/site/login_members.php');
?>