<?php
/*
AUTOFORM 1.0
THIS SCRIPT IS GPL LICENCE
AUTOR ROBERTO CARLOS ALEMAN FERRER
hide@address.com
www.ventics.com
AUTOFORM IS ENGINE FOR GENERATE AUTOMATIC FORM“S FROM
QUERY NAME OF FIELDS IN TABLE OF CURRENTDATABASE
/* this example show how run this class ...this code send data to example2.php, take it a call to DB , query name of field on table select , and build it form with the name of fields in orden, keep ID field , see the source and enjoy */
$table_for_query , nametable to query
$form_action , script for catch the POST vars send
*/
$form_action = "example2.php";
$table_for_query ="data";
include("autoform_class.php");
$objBd=new autoform("localhost","data","root","");
$objBd->conectarBD();
echo "<h2>Example of AUTOFORM</h2><BR>";
echo "<table border=1><tr><td><center>Field Name:</center></td><td><center>TextBox</center></td></tr>";
echo "<form action='$form_action' method='post' target='_self'>";
$fields=$objBd->consultarBD("select * from $table_for_query"); // show the fields for send data to POST method
echo "<input name='submit' type='submit' value='submit' />";
echo "</form>";
$objBd->terminar();
?>