mysql php form generator mysql php form generator mysql php form generator
mysql php form generator

Returning a PHP script instead of the field value

In this example, in View mode only, the record id is used to query the database to get the data and apply the PHP function highlight_string() to the field contents.

Field array:

$opts['fdd']['clip'] = array(
  'default'    => '',
  'input'      => '',
  'maxlen'     => 65535,
  'name'       => 'Clip',
  'options'    => 'ACPVDFL',
  'required'   => false,
  'select'     => 'T',
  'sqlw'       => 'TRIM("$val_as")',
  'textarea'   => array('rows' => '20', 'cols' => '120'),
  'trimlen|LF' => 50,
  'sort'       => false,
  'php|V'      => './triggers/highlight_string.php'
);

Contents of highlight_string.php

if ($this->operation == $this->labels['View']) {

  if($row = mysql_fetch_row(mysql_query("SELECT `clip` FROM `code_library` WHERE `id` = '{$this->rec}'"))){

    return highlight_string($row[0]);

  }

}


PHP Form Generator Home | PHP Form Generator Demo

mysql php form generator
mysql php form generator mysql php form generator mysql php form generator
Copyright © 2010 - All rights reserved - Tel (815) 301-5579 - Fax (815) 301-5579 - doug@hockinson.com

phpvs.com - hockinson.com - phpmyedit.org - platon.sk - denvermetro.org - cymaxmedia.com - cymax2.com

Hostgator.com web hosting