PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Keven Ages   Auto-Gen CSS Forms   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Use
Class: Auto-Gen CSS Forms
Generate forms to edit MySQL table records
Author: By
Last change: more documentation added
Date: 16 years ago
Size: 916 bytes
 

Contents

Class file image Download
<?php
require_once 'class.form.php';

//instantiate our class
$form = new Form;

//what is the table we're attaching to?
$form->tableName = "players";

//where is the processor?
//leave this out if you want the form to point to $_SERVER['PHP_SELF'];
$form->action = "/edit_profile/";

//if you leave the ID field out, it will generate a blank form, uncomment to populate the form with data from the db.

//$form->id = <<ENTER_THE_RECORD_ID_YOU_WANT_TO_SEE_IN_THE_FORM>>

//you can customize the submit button for use with ajax etc.
$form->custom_submit = "<a href=\"javascript:void(0);\" onclick=\"javascript:document.players.submit();this.innerHTML='editting...';\">edit profile</a><br />";

//if you need to hide certain fields in the form
$form->hiddenFields = array('user_name','password','last_login','created_on','team','group');

//now we'll make our form

print $form->insts();

?>