PHP Form Generator for use with phpMyEdit, PHP, and MySQL

About PHP Form Generator - Sample Script - PHP Form Generator - Help System

Sample Script - phpMyEdit Script

Code appearing below is a phpMyEdit script which you can access by clicking here

<?php

// Suggested filename: my_mfg_content.php
// Sat, 04 Sep 2010 11:02:41 -0600
// Requires phpMyEdit.class.php, language files, header, footer, and db connection.
// phpvs_mfg.mfg_content

ob_start('ob_gzhandler');

$opts = array();

$opts['tb'] = 'mfg_content';

$opts['key'] = 'id'// Primary key checked

$opts['key_type'] = 'int';

$opts['sort_field'] = array('id');

$opts['inc'] = 10;

$opts['options'] = 'ACPVDFL';

require_once(
'./inc/dbconn.php'); // Database logon + form navigation config + variables used by the page header

require_once('./inc/header2.php');

$opts['cgi']['append']['PME_sys_fl'] = 1// Force search feature ON (version 5.6)

$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];

$opts['filters'] = 'PMEtable0.deleted = "0"'// See ./triggers/mark_as_deleted.TDB.inc

/*

This bug note can be disabled by setting: $cfg_utf8_bug_note = 0;
If a MySQL v4.1 CHARSET is UTF8, a PHP v4.x mysql_field_len() function
may return incorrect values for the length of VARCHAR columns.
Table schema is provided below so that VARCHAR field lengths can be
compared with the 'maxlen' settings in the following field arrays.

CREATE TABLE `mfg_content` (
  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  `snum` smallint(5) unsigned NOT NULL DEFAULT '0',
  `pnum` smallint(5) unsigned NOT NULL DEFAULT '0',
  `link` varchar(255) NOT NULL DEFAULT '',
  `heading` varchar(255) NOT NULL DEFAULT '',
  `meta_title` varchar(255) NOT NULL DEFAULT '',
  `meta_desc` text NOT NULL,
  `meta_key` text NOT NULL,
  `html_1` text NOT NULL,
  `html_2` text NOT NULL,
  `php_script` varchar(255) NOT NULL DEFAULT '',
  `content` text NOT NULL,
  `td_left` enum('1','0') NOT NULL DEFAULT '1',
  `eval_content` enum('0','1') NOT NULL DEFAULT '0',
  `mli` enum('0','1') NOT NULL DEFAULT '0',
  `ul` enum('0','1','2','3','4','5','6','7','8','9') NOT NULL DEFAULT '0',
  `https` enum('0','1') NOT NULL DEFAULT '0',
  `nav` enum('0','1') NOT NULL DEFAULT '0',
  `hidden` enum('0','1') NOT NULL DEFAULT '0',
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  `spider` enum('1','0') NOT NULL DEFAULT '1',
  `priority` enum('0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0') NOT NULL DEFAULT '0.5',
  `changefreq` enum('always','daily','hourly','monthly','never','weekly','yearly') NOT NULL DEFAULT 'monthly',
  `posted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `snum` (`snum`),
  KEY `pnum` (`pnum`),
  KEY `hidden` (`hidden`),
  KEY `mli` (`mli`),
  KEY `deleted` (`deleted`),
  KEY `ul` (`ul`),
  FULLTEXT KEY `search_index` (`heading`,`content`)
) ENGINE=MyISAM AUTO_INCREMENT=147 DEFAULT CHARSET=utf8;

*/

// 'required' status is now post-initialized for easier readability with Javascript hints, validation, REGEX, etc.

// Column names are OK (based on an internal PHP5/MySQL5 Reserved Word list compiled June 2007)

$opts['fdd']['id'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '',
  
'input'      => 'R',
  
'maxlen'     => 6,
  
'name'       => 'Id',
  
'options'    => 'VD',
  
'select'     => 'T',
  
'size|ACP'   => 6,
//  'tab|ACP'    => 'ID',
  
'sort'       => true
);
// MySQL column 0: int - smallint(6)


$opts['fdd']['snum'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
//  'number_format|VDLF' => array(0, '.', ','),
  
'maxlen|ACP'     => 5,
  
'name'       => 'Snum',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size|ACP'   => 5,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 1: int - smallint(5) unsigned
$opts['fdd']['snum']['js']['required'] = true;
// $opts['fdd']['snum']['js']['regexp'] = '/^[0-9]*$/';
// $opts['fdd']['snum']['js']['hint'] = 'Please enter only numbers in the "Snum" field.';


$opts['fdd']['pnum'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
//  'number_format|VDLF' => array(0, '.', ','),
  
'maxlen|ACP'     => 5,
  
'name'       => 'Pnum',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size|ACP'   => 5,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 2: int - smallint(5) unsigned
$opts['fdd']['pnum']['js']['required'] = true;
// $opts['fdd']['pnum']['js']['regexp'] = '/^[0-9]*$/';
// $opts['fdd']['pnum']['js']['hint'] = 'Please enter only numbers in the "Pnum" field.';


$opts['fdd']['link'] = array(
  
'default'    => '',
  
'input'      => '',
  
'maxlen'     => 255,
  
'name'       => 'Link',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size|ACP'   => 60,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 3: string - varchar(255)
$opts['fdd']['link']['js']['required'] = true;


$opts['fdd']['heading'] = array(
  
'default'    => '',
  
'input'      => '',
  
'maxlen'     => 255,
  
'name'       => 'Heading',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size|ACP'   => 60,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 4: string - varchar(255)


$opts['fdd']['meta_title'] = array(
  
'default'    => '',
  
'input'      => '',
  
'maxlen'     => 255,
  
'name'       => 'Meta Title',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size|ACP'   => 60,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 5: string - varchar(255)


$opts['fdd']['meta_desc'] = array(
  
'default'    => '',
  
'input'      => '',
  
'name'       => 'Meta Desc',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'sqlw'       => 'TRIM("$val_as")',
  
'strip_tags|LF' => true,
  
'textarea'   => array('rows' => '5''cols' => '58'),
  
'trimlen|LF' => 50,
  
'sort'       => false
);
// MySQL column 6: blob - text


$opts['fdd']['meta_key'] = array(
  
'default'    => '',
  
'input'      => '',
  
'name'       => 'Meta Key',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'sqlw'       => 'TRIM("$val_as")',
  
'strip_tags|LF' => true,
  
'textarea'   => array('rows' => '5''cols' => '58'),
  
'trimlen|LF' => 50,
  
'sort'       => false
);
// MySQL column 7: blob - text


$opts['fdd']['html_1'] = array(
  
'default'    => '',
  
'input'      => '',
  
'name'       => 'Html 1',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'sqlw'       => 'TRIM("$val_as")',
  
'strip_tags|LF' => true,
  
'textarea'   => array('rows' => '5''cols' => '58'),
  
'trimlen|LF' => 50,
  
'sort'       => false
);
// MySQL column 8: blob - text


$opts['fdd']['html_2'] = array(
  
'default'    => '',
  
'input'      => '',
  
'name'       => 'Html 2',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'sqlw'       => 'TRIM("$val_as")',
  
'strip_tags|LF' => true,
  
'textarea'   => array('rows' => '5''cols' => '58'),
  
'trimlen|LF' => 50,
  
'sort'       => false
);
// MySQL column 9: blob - text


$opts['fdd']['php_script'] = array(
  
'default'    => '',
  
'input'      => '',
  
'maxlen'     => 255,
  
'name'       => 'Php Script',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'size|ACP'   => 60,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 10: string - varchar(255)


$opts['fdd']['content'] = array(
  
'default'    => '',
  
'input'      => '',
  
'name'       => 'Content',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'sqlw'       => 'TRIM("$val_as")',
  
'strip_tags|LF' => true,
  
'textarea'   => array('rows' => '5''cols' => '58'),
  
'trimlen|LF' => 50,
  
'sort'       => false
);
// MySQL column 11: blob - text


$opts['fdd']['td_left'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '1',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Td Left',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('1','0'), 
  
'sort'       => true
);
// MySQL column 12: string - enum('1','0')
// $opts['fdd']['td_left']['values2'] = array('1' => 'Yes', '0' => 'No');


$opts['fdd']['eval_content'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Eval Content',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1'), 
  
'sort'       => true
);
// MySQL column 13: string - enum('0','1')
// $opts['fdd']['eval_content']['values2'] = array('0' => 'No', '1' => 'Yes');


$opts['fdd']['mli'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Mli',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1'), 
  
'sort'       => true
);
// MySQL column 14: string - enum('0','1')
// $opts['fdd']['mli']['values2'] = array('0' => 'No', '1' => 'Yes');


$opts['fdd']['ul'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Ul',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1','2','3','4','5','6','7','8','9'), 
  
'sort'       => true
);
// MySQL column 15: string - enum('0','1','2','3','4','5','6','7','8','9')


// '### The column `https` appears to be a reserved word in PHP or MySQL. ###';
// '### Please rename `https` to avoid unexpected results. ###';
$opts['fdd']['https'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Https',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1'), 
  
'sort'       => true
);
// MySQL column 16: string - enum('0','1')
$opts['fdd']['https']['URL']       = 'http://$value';
$opts['fdd']['https']['URLtarget'] = '_blank';
// $opts['fdd']['https']['values2'] = array('0' => 'No', '1' => 'Yes');


$opts['fdd']['nav'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Nav',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1'), 
  
'sort'       => true
);
// MySQL column 17: string - enum('0','1')
// $opts['fdd']['nav']['values2'] = array('0' => 'No', '1' => 'Yes');


$opts['fdd']['hidden'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Hidden',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1'), 
  
'sort'       => true
);
// MySQL column 18: string - enum('0','1')
// $opts['fdd']['hidden']['values2'] = array('0' => 'No', '1' => 'Yes');


$opts['fdd']['deleted'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Deleted',
  
'options'    => 'ACP',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0','1'), 
  
'sort'       => true
);
// MySQL column 19: string - enum('0','1')
if($operation == 'Add'){ $opts['cgi']['overwrite']['deleted'] = '0'; }
$opts['triggers']['delete']['before'] = './triggers/mark_as_deleted.TDB.inc';
// $opts['fdd']['deleted']['values2'] = array('0' => 'No', '1' => 'Yes');


$opts['fdd']['spider'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '1',
  
'input'      => '',
  
'maxlen'     => 1,
  
'name'       => 'Spider',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('1','0'), 
  
'sort'       => true
);
// MySQL column 20: string - enum('1','0')
// $opts['fdd']['spider']['values2'] = array('1' => 'Yes', '0' => 'No');


$opts['fdd']['priority'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0.5',
  
'input'      => '',
  
'maxlen'     => 3,
  
'name'       => 'Priority',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0'), 
  
'sort'       => true
);
// MySQL column 21: string - enum('0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0')


$opts['fdd']['changefreq'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => 'monthly',
  
'input'      => '',
  
'maxlen'     => 7,
  
'name'       => 'Changefreq',
  
'options'    => 'ACPVD',
  
'select'     => 'D',
  
'sqlw'       => 'TRIM("$val_as")',
  
'values'     => array('always','daily','hourly','monthly','never','weekly','yearly'), 
  
'sort'       => true
);
// MySQL column 22: string - enum('always','daily','hourly','monthly','never','weekly','yearly')


$opts['fdd']['posted'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '0000-00-00 00:00:00',
  
'input'      => '',
  
'maxlen'     => 19,
  
'name'       => 'Posted',
  
'options'    => 'ACPVD',
  
'select'     => 'T',
  
'size|ACP'   => 19,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 23: datetime
// Possible default: date('Y-m-d H:i:s')


$opts['fdd']['updated'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => 'CURRENT_TIMESTAMP',
  
'input'      => 'R',
  
'maxlen'     => 19,
  
'name'       => 'Updated',
  
'options'    => 'VD',
  
'select'     => 'T',
  
'size|ACP'   => 19,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
// MySQL column 24: timestamp


// Enable this trigger induce View mode after adding a new record
// $opts['triggers']['insert']['after'] = './triggers/view_rec_after_add.php';

// require_once('./inc/notify/all.php'); // See ./output/inc/notify/*.php

require_once('./inc/phpMyEdit.class.php');

new 
phpMyEdit($opts);

require_once(
'./inc/footer2.php');

?>

All sales are final. No refunds.
If you lack basic skills with PHP / MySQL, don't buy this product.
(refund policy abandoned due to Newbie abuse)

  New version imminent. Display a few columns + toggle links for other columns.
Beta version soon available to previous (or new) buyers.
See http://www.php-html-form.com/sakila/

PaypalPayment via PayPal "should" result in a ZIP
file being emailed as soon as the sale is confirmed.
If not received in a few minutes, check your Spam folder.
(If not received within 15-20 minutes, send email).

Allow up to 24 hours for delivery via email when selecting Google Checkout.



Keywords: automatic form generator, builder developer, cgi builder, cgi form, create builder, data entry forms, database builder, database form, email form script, email form, form builder, form class, form component, form generator, form mail, form maker, form processors, form programming, form reports, form script, form scripts, form source, form tutorial, form, forms builder, forms tutorial, forms, html form, mail builder, mysql database, mysql form generator, mysql form, mysql script, mysql table, mysql, object builder, perl form, php code, php form generator, php form script, php form, php script, php scripts, php, phpmyedit, report builder, source builder, string builder, validation, web database, web form generator, web form, web forms

Multi Form Generator by Doug Hockinson - doug@hockinson.com
Denver, Colorado USA - VoiceMail / FaxMail (815) 301-5579
php-form-generator.com - hockinson.com - phpvs.com

Hostgator.com web hosting