Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Roberto Aleman  >  AutoForm  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: AutoForm
Generate forms to edit MySQL table records
Author: By
Last change: update, example script
Date: 2007-09-02 19:40
Size: 1,212 bytes
 

Contents

Class file image Download


 <?php
   
/*

AUTOFORM 1.0
THIS SCRIPT IS GPL LICENCE
AUTOR ROBERTO CARLOS ALEMAN FERRER
robertoaleman@hotmail.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();

    
?>