openform()

The function should be able used to replace conventional <form> tags to provide an enhanced feature to your application.

Versions: 9

openform( string $form_name, string $method [, string $action_url, array $options ] ) : string

Parameters

$form_name (string) (Required) Form ID.

$method (string) (Required) Possible value: post, get.

$action_url (string) (Optional) Form current uri. Default value: FORM_REQUEST

$options (array) (Optional) Default value: []

Version 9
Version 10
Version 9

Name

Type

Default

Description

form_id

string

$form_name

class

string

''

CSS class properties.

enctype

bool

false

Set true for allowing multipart.

max_tokens

int

$settings['form_tokens']

inline

bool

false

Set true for making form inline.

on_submit

string

''

Adds javascript function on form submit.

honeypot

bool

true

Enables honeypots to counter botting.

Version 10

In Version 10, the function is further extended to allow more enhanced options features to handle post and sanitization. This enhancement allows code to be more simplified and be more robust.

Support feature is currently under development.

Name

Type

Default

Description

post_db

string

Set table to target.

post_id_col

string

Primary key column.

post_id_value

string

Primary value for primary key column.

post_button

string

Post button name. Array or string supported.

post_mode

string

save

Form action. Save, Update, Auto.

post_success_message

string

Set a system message for successful post.

post_redirect_url

string

FORM_REQUEST

Redirect url for post.

post_data

string

Callback data in the event.

no_unique

bool

false

Set true if current table have no primary column.

post_mapping

string

Specify which table and column relationships in an array format.

post_function

Specify custom post functions. Can have multiple functions declared using array.

post_debug

bool

false

Set true for debug mode.

Return Values

(string)

Examples

echo openform('testform', 'post');