?ID=1">retrieving a record</a>.
</div>

<div class="boxed">
<?php 
/*** change the following variables ***/
$user = "******";
$pass = "******";
$DB = "database";
//include class, create new Formitable, set primary key field name
include "../Formitable.class.php";
$newForm = new Formitable(@mysql_connect("localhost", $user, $pass), $DB, "formitable_demo");
$newForm->setPrimaryKey("ID");
$newForm->setEncryptionKey("g00D_3nCr4p7");
//hide primary key field, force a few field types
$newForm->hideField("ID");
$newForm->forceTypes(array("foods", "day_of_week"), array("checkbox", "radio"));
//get data pairs from another table
$newForm->normalizedField("toon", "formitable_toons", "ID", "name", "pkey ASC");
//set custom field labels
$newForm->labelFields(array("f_name", "l_name", "description", "pets", "foods", "color", "day_of_week", "b_day", "toon"), array("First Name", "Last Name", "About Yourself", "Your Pets", "Favorite Foods", "Favorite Color", "Favorite Day", "Your Birthday", "Favorite Cartoon"));
//set some default values
$newForm->setDefaultValue("pets", "Dog");
$newForm->setDefaultValue("color", "Blue");
$newForm->setDefaultValue("toon", "3");
$newForm->setDefaultValue("foods", "pizza,salad");
$newForm->setDefaultValue("day_of_week", date("l"));
//set up regular expressions for field validation
$newForm->registerValidation("required", ".+", "Input is required.");
//set up a field for validation using regex above
$newForm->validateField("f_name", "required");
<?php

#create form object
$profile = new Formitable($db, 'sionapros_users');
#set primary key field
$profile->setPrimaryKey('identifier');
$profile->setEncryptionKey("EHm1C_3nCr4p7");
$persNoSQL = "SELECT identifier FROM sionapros_users WHERE username = '******'loginUsername']}'";
$res = $db->execute($persNoSQL);
#retrieve profile's data
$profile->getRecord($res[0]['identifier']);
#hide primary key field
$profile->hideField('identifier');
#customiszing form
$profile->hideField('reg_date');
$profile->hideField('identifier');
$profile->hideField('username');
$profile->hideField('password');
$profile->hideField('change_password');
$profile->hideFields(array('account_status'));
#custom labels
$profile->labelFields(array('firstname', 'lastname'), array('First Name *', 'Last Name *'));
//set up regular expressions for field validation
$profile->registerValidation("required", ".+", "Input is required.");
//set up fields for validation using regexs above
$profile->validateField("firstname", "required");
$profile->validateField("lastname", "required");
#set default values
#submit msg
$profile->msg_updateSuccess = "Your Profile was updated successfully.";
//set all output to be returned instead of printed
<?php

#get staff personnel_no
#$staff_no = $_GET['identifier'];
if (isset($_GET['identifier'])) {
    $_SESSION['upd_no'] = $_GET['identifier'];
}
#create form object
$staff = new Formitable($db, 'sionapros_users');
#set primary key field
$staff->setPrimaryKey('identifier');
$staff->setEncryptionKey("qHm1rC_3nCt4p7");
#retrieve staff's data
$staff->getRecord($_SESSION['upd_no']);
#hide primary key field
$staff->hideField('identifier');
#customiszing form
$staff->hideField('reg_date');
$staff->hideField('identifier');
$staff->hideField('username');
$staff->hideField('password');
$staff->forceTypes(array('account_status', 'change_password'), array('select', 'select'));
#custom labels
$staff->labelFields(array('firstname', 'lastname'), array('First Name *', 'Last Name *'));
$staff->labelFields(array('account_status', 'change_password'), array('Account Status *', 'Change Password *'));
//set up regular expressions for field validation
$staff->registerValidation("required", ".+", "Field MUST be filled in please.");
//set up fields for validation using regexs above
$staff->validateField("firstname", "required");
$staff->validateField("lastname", "required");
$staff->validateField("change_password", "required");