Getting Started with ApPHP DataForm (for v3.0.0 or above)

1. Common Notices


We use
## as comments
// as lines, that must be uncommented
/// as lines, that may be uncommented (optional)

Common notes.

Please, use a $debug_mode = true; before you say "Why Nothing Works ?!"
Starting with version 2.0.0 only PHP5 is supported!
Do not put DataForm code into another HTML form: <form>...</form>
Be careful when using the names of fields they may be case sensitive.
For the best performance use ob_start(); before and ob_end_flush(); after DataForm code.

2. Getting Started

Step 1. Creating & Calling.

Be sure you write here a right relative (virtual) path to the DataForm.class.php file (relatively to the file).
/* Ex.: 'dataform/' or '../dataform/' */
define ('DATAFORM_DIR', '');
Creating the a new class instance and linking the DataForm class to our database. We can add a unique prefix (optional) to our DataForm if we want to prevent using of double names on this page (in case, when you use some DataForms or forms on same page).
## *** set needed options and create a new class instance 
// display SQL statements while processing 
$debug_mode = false;
// display system messages on a screen     
$messaging = true;
// prevent overlays - must be started with a letter
$unique_prefix = 'abc_';
$dform = new DataForm($debug_mode, $messaging, $unique_prefix);
If you want to use a local language (not English) - you have to set the right encoding. The database, tables and appropriate fields in your database must be created with the same CHARACTER SET and COLLATE too. Also you need to define in your file: header('Content-type: text/html; charset=XXXX'); where XXXX is ISO-8859-1 or UTF-8 or whatever you have: CHARSET=utf8 COLLATE=utf8_unicode_ci
Example: <meta http-equiv=Content-Type content="text/html; charset=UTF-8">
## *** set encoding (default - utf8)
$df_encoding = 'utf8'; 
Assign proper values for these variables. Make sure, you use a database prefix if you need it.
## *** creating variables that we need for database connection 
$DB_USER = 'user_username'; /* usually like this: prefix_name           */
$DB_PASS = 'user_password'; /* must be already encrypted (recommended)  */
$DB_HOST = 'localhost';     /* usually localhost                        */
$DB_NAME = 'db_name';       /* usually like this: prefix_dbName         */
Now we need to set data source to the DataForm.
## *** set data source
$dform->DataSource('PDO', 'mysql', $DB_HOST, $DB_NAME, $DB_USER, $DB_PASS); 

Step 2. General Settings.

## --- Languages ---------------------------------------------------------------
Set interface language for DataForm (en - default). All supported languages are listed under commented lines.
## *** (ar) - Arabic        (bg) - Bulgarian  (ca) - Catala    (ch) - Chinese
## *** (cz) - Czech         (da) - Danish     (de) - German    (en) - English
## *** (es) - Espanol       (fr) - Francais   (gk) - Greek     (he) - Hebrew
## *** (hu) - Hungarian     (hr) - Bosnian/Croatian            (it) - Italiano
## *** (ja) - Japanese      (ko) - Korean     (nl) - Netherlands/Vlaams(Flemish)
## *** (lt) - Lithuanian    (pl) - Polish     (pb) - Brazilian Portuguese
## *** (ro) - Romanian      (ru) - Russian    (sv) - Swedish   (sr) - Serbian
## *** (tr) - Turkish                 

$df_language = 'en';  
Option for some right-to-left languages (Hebrew, Arabic etc.)
## *** set direction: 'ltr' or 'rtl' (default - ltr)
$direction = 'ltr';
## --- Modes & Operations ------------------------------------------------------
Set various modes for DataForm. true - allow the operation in this mode, false - don't allow.
## *** set modes for operations
$modes = array('add' =>true, 'insert' =>true, 'preview' =>true, 'edit' =>false);
Set Record ID for Edit Mode. If record ID not equal zero and 'edit'=>true in SetModes(), the DataForm will open in Edit Mode by default.
## *** set edit or details mode RecordID    
$df_rid = 0;  
Define using of Captcha.
## *** define using of Captcha
## *** make sure you have started session with session_start();
## *** captcha types: 'standard' or 'math'
$df_captcha = true;
$df_captcha_type = 'standard';
$dform->SetCaptcha($df_captcha, $df_captcha_type);
Set variables that you use to get access to your page or have passed from the previous page/s.
## *** set variables that used to get access to the page 
## *** (like: my_page.php?act=34&id=56 etc.)
$http_get_vars = array('act', 'id');
Define mode after successful insertion - '' or 'add'
$df_mode_after_insert = 'add';
Set DataForm cancel link
## *** set DataForm cancel link (ex.:
$df_cancel_link = '';
Set DataForm result page HTML
## *** set DataForm result page HTML
$df_result_html = 'New product was successfully added!';
Set email notification on successful insertion
## *** set email notification about successful insertion
Specifies settings of javascript validation error messages
## *** set javascript error messages settings
$df_js_display_style = 'all'; 
$df_js_container = 'popup'; 
  array('display_style'=>$df_js_display_style, 'container'=>$df_js_container)
## --- Templates & CSS ---------------------------------------------------------
Set CSS parameters for the DataForm. If you want to use your own css class - create folder with needed images in images/YOUR_NEW_CSS/ and YOUR_NEW_CSS.css file in CSS/ folder.
*** customized templates@field_name_1@ - field header
{field_name_1} - field value
[CAPTCHA][CANCEL][ADD] - allowed elements and operations (must be placed in $add_template only
[CANCEL][EDIT][CREATE] - allowed elements and operations (must be placed in $preview_template only
$df_allow_templates = false;
$add_mode_template = '';
$preview_mode_template = '';
$dform->SetTemplates($add_mode_template, $preview_mode_template);
Embedded CSS styles: 'default', 'empty', 'custom', 'custom-x' (v3.x.x or above) or your own css style
## *** set CSS class for DataForm
## *** 'default|empty|custom|custom-x' 
## *** or your own css style
$css_class = 'default'; 
Set DataForm title (caption).
## *** set DataForm Caption
$df_caption = 'My Favorite Lovely ApPHP DataForm';

Step 3. Modes Settings.

Set Add Mode table properties (% or px).
## *** set Add Mode table properties
$am_table_properties = array('width'=>'700px');
Set Preview Mode table properties (% or px).
## *** set Preview Mode table properties
$pm_table_properties = array('width'=>'400px');
Set settings for Add/Insert Modes
## ***  set settings for Add/Insert Modes  
// Table for insertion
$table_name  = 'table_name';
// Primary key for this table
$primary_key = 'primary_key'; 
// Condition. Ex.: table_name.field = 'xxx'
$condition = '';
$dform->SetTable($table_name, $primary_key, $condition);

This method sets up columns, that will be viewable.
For all types:
'header'=>'...' - name of the column's header
'type'=>'...' - type of the column.
Possible values: 
textbox,          textarea, 
label,            password,  
print,            date(yyyy-mm-dd), 
enum,             datedmy(dd-mm-yyyy),
hidden,           datemdy(mm-dd-yyyy), 
image,            datetime(yyyy-mm-dd hh:mm:ss), 
checkbox,         datetimedmy(dd-mm-yyyy hh:mm:ss),                  
file,             datetimemdy(mm-dd-yyyy hh:mm:ss),                    
delimiter,        link (http://, mailto:, ftp://)
'req_type'=>'...' - field parameters:
first letter: 
r - required,      s - simple (not required)
second letter: 
t - text(including datetime), 
n - numeric,       a - alphanumeric, 
e - email,         b - alphanumeric,
y - any,           f - float, 
z - zipcode,       l - login name, 
i - integer,       p - password, 
u - URL,           v - verified
third letter (optional): 
for numbers: s - signed, u - unsigned, p - positive, n - negative
for strings: u - upper,  l - lower,    n - normal,   y - any 
'align'=>'...' - field horizontal align
Possible values: left, center, right
'width'=>'...' - width of the field in pixels
'title'=>'...' - title (tooltip) of the field
'readonly'=>'...' - if the filed is readonly (false|true)
'maxlength'=>'...' - maximal size in characters of the field value
'default'=>... - default value for the field (for add mode only)
'unique'=>... - make or not (true|false) validation for unique values for this field
'unique_condition'=>... - validation for unique values for this field by the condition (ex.: field_1 > 1 OR field_2 = 99)
'on_js_event'=>'...' - javascript code or js function on some event. Example: onClick(alert('Clicked!'))

For the 'link' type:
'field_key'=>'field_name_0'|'field_key_1'=>'field_name_1'|..., - field for href parameter in <a href='...field_key_x...'>
'field_data'=>'...', - field for <a href=''>field_data
'href'=>'...' - href parameter, {0}/{1}/... will be changed on 'field_key_0/1/...' value
'target'=>'...' - target parameter

For the 'image' type:
Make sure, that target_path directory has 755 permissions
'target_path'=>'...' - relative (or full) path to image
'file_name'=>'...' - set new name for image or use an original file name
'max_file_size'=>'...' - maximal image size allowed. Ex.: 1000, 10K, 1.2M or 1G
'image_width'=>'...' - viewing width of image
'image_height'=>'...' - viewing height of image
'resize_image'=>'' - (true or false) allow resizing of images
'resize_width'=>'' - (Xpx) set new width of resized images (leave blank if you want to save aspect ratio by height)
'resize_height'=>'' - (Xpx) set new height of resized images (leave blank if you want to save aspect ratio by width)
'magnify'=>'' - (true or false) allow magnifying of images
'magnify_type'=>'' - ('popup', 'magnifier' or 'lightbox') defines a type of magnifying
'magnify_power'=>'2' - number, that defines a power of magnifying
'allowed_extensions'=>'' - list of allowed extensions

For the 'file' type:
Make sure, that target_path directory has 755 permissions
'target_path'=>'...' - relative (or full) path to file
'file_name'=>'...' - set new name for file use an original file name
'max_file_size'=>'...' - maximal image size allowed. Ex.: 1000, 10K, 1.2M or 1G
'allowed_extensions'=>'' - list of allowed extensions

For the 'checkbox' type:
'true_value'=>'...' - set value for checked checkbox
'false_value'=>'...' - set value for unchecked checkbox

For the 'enum' type:
'source'=>'...' - source for enum type. Possible values: 'self' or from customized array
'view_type'=>'...' - view type of the field: dropdownlist (default), radiobutton or checkbox
'radiobuttons_alignment'=>'horizontal|vertical' - type of radiobuttons alignment
'multiple'=>... - true or false (default) - if allow multirows listbox
'multiple_size'=>... - number of rows in multirows listbox (4 - default)
// Fill enum type from the array (optional)
$fill_from_array = array('0'=>'No','1'=>'Yes','2'=>"Don't know",'3'=>'My be');
For the 'hidden' type:
'default'=>'...' - default value for the field (in Add Mode)
'value'=>'...' - new value for the field (in Edit Mode)

For the 'textarea' type:
'edit_type'=>'...' - simple view - 'simple' or advanced wysiwyg editor - 'wysiwyg'
'resizable'=>'...' - if the textarea can be resized by mouse
'rows'=>'...' - number of rows (default 7)
'cols'=>'...' - number of columns (default - 50)

For the 'delimiter_1|2|3...' type:
'inner_html'=>'...' - html for delimiter row

For the 'validator' type:
'for_field'=>'...' - name of the field for validation process
'validation_type'=>'password|email' - type of validation field

For the 'password' type:
'hide'=>'' - (true or false) show password or display ******
'generate'=>'' - (true or false) draw button (link) for random generating of password
'cryptography'=>'' - (true or false) is any cryptographic method used
'cryptography_type'=>'' - (aes or md5) define cryptographic method
'aes_cryptography'=>'' - password (key) for aes cryptographic function

For the 'color' type:
'view_type'=>'dropdownlist' - set value for type of viewing: 'dropdownlist' or 'picker'

For the 'textbox' type:
'autocomplete'=>'true', 'handler'=>'modules/autosuggest/test.php', 'maxresults'=>'12', 'shownoresults'=>'false' - set autocomplete feature

$am_columns = array(
    'FieldName_1'  =>array('header'=>'Name_A', 'type'=>'textbox',    'req_type'=>'rt', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>''),
    'FieldName_2'  =>array('header'=>'Name_B', 'type'=>'textarea',   'req_type'=>'rt', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'edit_type'=>'simple|wysiwyg', 'resizable'=>'false', 'rows'=>'7', 'cols'=>'50'),
    'FieldName_3'  =>array('header'=>'Name_C', 'type'=>'label',      'req_type'=>'st', 'title'=>'', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>''),
    'FieldName_4'  =>array('header'=>'Name_D', 'type'=>'date',       'req_type'=>'rt', 'width'=>'187px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'calendar_type'=>'popup|floating|dropdownlist'),
    'FieldName_5'  =>array('header'=>'Name_E', 'type'=>'datetime',   'req_type'=>'st', 'width'=>'187px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'calendar_type'=>'popup|floating|dropdownlist'),
    'FieldName_6'  =>array('header'=>'Name_F', 'type'=>'time',       'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'calendar_type'=>'popup|dropdownlist'),
    'FieldName_7'  =>array('header'=>'Name_G', 'type'=>'image',      'req_type'=>'st', 'width'=>'220px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'target_path'=>'uploads/', 'max_file_size'=>'100000|100K|10M|1G', 'image_width'=>'120px', 'image_height'=>'90px', 'resize_image'=>'false', 'resize_width'=>'', 'resize_height'=>'', 'magnify'=>'false', 'magnify_type'=>'popup|lightbox', 'magnify_power'=>'2', 'file_name'=>'', 'allowed_extensions'=>'', 'host'=>'local|remote'),
    'FieldName_8'  =>array('header'=>'Name_H', 'type'=>'password',   'req_type'=>'rp', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'hide'=>'false', 'generate'=>'true', 'cryptography'=>'false', 'cryptography_type'=>'aes|md5', 'aes_password'=>'aes_password'),
    'FieldName_9'  =>array('header'=>'Name_I', 'type'=>'money',      'req_type'=>'rf', 'width'=>'80px',  'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'sign'=>'$', 'sign_place'=>'before|after', 'decimal_places'=>'2', 'dec_separator'=>'.', 'thousands_separator'=>','),
    'FieldName_10' =>array('header'=>'Name_J', 'type'=>'enum',       'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'source'=>'self'|$fill_from_array, 'view_type'=>'dropdownlist(default)|radiobutton', 'radiobuttons_alignment'=>'horizontal|vertical', 'multiple'=>'false', 'multiple_size'=>'4'),
    'FieldName_11' =>array('header'=>'Name_K', 'type'=>'print',      'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>''),
    'FieldName_12' =>array('header'=>'Name_L', 'type'=>'checkbox',   'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'true_value'=>1, 'false_value'=>0),
    'FieldName_13' =>array('header'=>'Name_M', 'type'=>'file',       'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'target_path'=>'uploads/', 'max_file_size'=>'100000|100K|10M|1G', 'file_name'=>'File_Name', 'allowed_extensions'=>'', 'host'=>'local|remote'),
    'FieldName_14_a' =>array('header'=>'Name_N (for add/insert mode)', 'type'=>'link', 'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>''),
    'FieldName_14_b' =>array('header'=>'Name_N (for preview mode)',    'type'=>'link', 'req_type'=>'st', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'field_key'=>'', 'field_key_1'=>'', 'field_data'=>'', 'rel'=>'', 'title'=>'', 'target'=>'_self', 'href'=>'{0}'),
    'FieldName_15' =>array('header'=>'Name_O', 'type'=>'foreign_key','req_type'=>'ri', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true'),
    'FieldName_16' =>array('header'=>'Name_P', 'type'=>'blob',       'req_type'=>'st', 'readonly'=>'false'),
    'FieldName_17' =>array('header'=>'',       'type'=>'hidden',     'req_type'=>'st', 'default'=>'default_value', 'unique'=>'false'),
    'FieldName_19' =>array('header'=>'Name_S', 'type'=>'color',      'req_type'=>'rt', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'unique'=>'false', 'unique_condition'=>'', 'visible'=>'true', 'on_js_event'=>'', 'view_type'=>'dropdownlist|picker', 'save_format'=>'hexcodes'),
    'validator'    =>array('header'=>'Name_N', 'type'=>'validator',  'req_type'=>'rv', 'width'=>'210px', 'title'=>'', 'readonly'=>'false', 'maxlength'=>'-1', 'default'=>'', 'visible'=>'true', 'on_js_event'=>'', 'for_field'=>'', 'validation_type'=>'password|email'),
    'delimiter_1|2|3...' =>array('inner_html'=>'<br>'),

If you want to get auto-generated columns - set $auto_column_in_add_mode as true.
## *** set auto-generated columns in add mode
$auto_column_in_add_mode = false;
Settings for the foreign keys.
'ForeignKey_1/2/3.../n'=>'...' - foreign key from 'Edit' table
'table'=>'...' - foreign table name
'field_key'=>'...' - key in foreign table
'field_name'=>'...' - filed, that will be viewed or virtual field: 'field_name'=>'CONCAT(field1, " ", field2) as field3'
'view_type'=>'...' - view type. Possible values: dropdownlist(default), radiobutton, texbox or label
'condition'=>'...' - some condition. Ex.: TableName_1.FieldName > 'a' AND TableName_1.FieldName < 'c'
'order_by_field'=>'...' - sorting order by the filed
'order_type'=>'...' - sorting type
'on_js_event'=>'...' - javascript code or js function on some event. Example: onClick(alert('Clicked!'))

## *** set foreign keys for add/edit/details modes (if there are linked tables)
## *** Ex.: 'condition'=>'TableName_1.FieldName > "a" AND TableName_1.FieldName < "c"'
## *** Ex.: 'on_js_event'=>'onclick="alert(\'Yes!!!\');"'
$foreign_keys = array(
    'ForeignKey_1'=>array('table'=>'TableName_1', 'field_key'=>'FieldKey_1', 'field_name'=>'FieldName_1', 'view_type'=>'dropdownlist(default)|radiobutton|textbox', 'condition'=>'', 'order_by_field'=>'My_Field_Name', 'order_type'=>'ASC|DESC', 'on_js_event'=>''),
    'ForeignKey_2'=>array('table'=>'TableName_2', 'field_key'=>'FieldKey_2', 'field_name'=>'FieldName_2', 'view_type'=>'dropdownlist(default)|radiobutton|textbox', 'condition'=>'', 'order_by_field'=>'My_Field_Name', 'order_type'=>'ASC|DESC', 'on_js_event'=>'')

Step 4. Bind the DataForm.

Now we need to bind our DataForm and draw it on the screen. If you don't need to draw DataForm on the screen for some reason - call this method with 'false' parameter $dform->Bind(true);
*** bind the DataForm and draw it on the screen

3. Non-Documented features and functions.


Allows automatical getting focus on the first displayed field in edit mode (default - false)
first_field_focus_allowed = true|false;
Block all operations (Add/Update/Delete/Upload) on DataForm
isDemo = true|false;
Defines using of escaping special characters in a string
allowRealEscape = true|false;
Defines a separator for datetime fields (private)
dtSeparator = '-';
Defines whether to envelop table names with quotes (default - false)
addBackQuotes = true|false;


Executes SQL query - use it after dataSource() method only (after the using dataSource() need to be recalled)
// Example:
// $sql = 'SELECT * FROM tblPresidents WHERE CountryID = '.$_GET['f_rid'];
// $dSet = $dform->ExecuteSql($sql);
// while($row = $dSet->dfFetchRow()){
//  for($c = 0; ($c < $dSet->numCols()); $c++){ echo $row[$c].' '; }
//  echo '<br>';
// }
Returns first column data from SELECT SQL - use it after DataSource() method only (using this method before bind() requires redefenition of DataSource())
// Example:
// $sql = 'SELECT COUNT(id) FROM tblPresidents WHERE CountryID = '.$_GET['f_rid'];
// $presidents = $dform->SelectSqlItem($sql);
Returns next id of edit table
Re-defines DataForm messages in add or insert modes
SetDfMessages('add', 'insert')
Returns true value, if current operation was successfully completed
Ignore HTML <BASE> tag
Display loading image
Set default timezone
Defines attribute 'action' for submission form
Specifies whether to force database encoding on each connection
Returns ID of the last inserted record
Specifies whether to add annchor to DataForm


In Add mode: 'Autocomplete' attribute for textboxes in (default - 'on')
Attributes in view mode for labels and in view/add/edit/details modes for textboxes
'pre_addition'=>''; and 'post_addition'=>'';
Runs user's pre-defined function on_item_created event attributes in view/add/edit/details modes for customized work with field value. This function must be defined with 1 parameter, that will get fild's data. Ex.: function function_name($field_value){ ... return $new_field_value;}
'on_item_created' => 'function_name'
In Add mode: 'align' attribute for fields
In Add/Edit mode: placeholder for textbox fields


Allows using user's javascript function for extra checkings on form submission in edit mode
// Example: 
// unique_prefix_ - an unique prefix for the DataForm
// <script type='text/javascript'>
// function unique_prefix_onSubmitMyCheck(){
//   alert("Thanks for adding/updating your data!");
//   return true;
// }	
// </script>
Allows reloading form in Edit mode
'on_js_event'=>'onchange="_dfFormAction(\'\', \'\', \''.$dform->uniquePrefix.'\', \''.$dform->HTTP_URL.'\', \''.$_SERVER['QUERY_STRING'].'\')"'

true - draw DataForm on the screen
false - do all needed actions, but don't draw DataForm on the screen

4. Tricks.

1. Set default value, that disappears on focus:

'default'=>'', 'on_js_event'=>'onBlur="if(this.value == \'\') this.value = \'\';\'#f68d6f\';" onClick="if(this.value==\'\') this.value=\'\';\'#000000\';"',

2. Set unique value for uploading image:

a) 'file_name'=>'img_'.((isset($_GET['prfx_mode']) && ($_GET['prfx_mode'] == 'add')) ? $dform->GetNextId() : $dform->GetCurrentId())
b) 'file_name'=>'img_'.((isset($_GET['prfx_mode']) && ($_GET['prfx_mode'] == 'add')) ? $dform->GetRandomString('10') : $dform->GetCurrentId())

Create Your Free Account
Please remember that this information is essential to use our services correctly.
After creating the account you will be able to download all of our FREE products.
Fields marked with * are mandatory

Please send me information about updates, new products, specials and discounts from ApPHP!
We recommend that your password should be at least 6 characters long and should be different from your username/email. Please use only letters of the English alphabet to enter your name.

Your e-mail address must be valid. We use e-mail for communication purposes (order notifications, etc). Therefore, it is essential to provide a valid e-mail address to be able to use our services correctly.

All your private data is confidential. We will never sell, exchange or market it in any way. Please refer to Privacy Policy.

By clicking "Create Account", you are indicating that you have read and agree to the ApPHP Terms & Conditions.