Location: PHPKode > scripts > Auto form > delete_example.php
 * This script is developed by Arturs Sosins aka ar2rsawseen, http://code-snippets.co.cc
 * Fee free to distribute and modify code, but keep reference to its creator
 * Auto form class can generate simple update, insert, select and delete 
 * HTML forms, form validation and form processing programmatically
 * based on information from mysql table
 * For more information, examples and online documentation visit: 
 * http://code-snippets.co.cc/PHP-classes/Generate-forms-programmatically


//on success callback - rows removed
function rows_removed($cnt)
	echo "<p>".$cnt." rows removed</p>";

//modifying values - hashing password
function hash_pass($arr)
	$arr["password"] = md5($arr["password"]);
	return $arr;
//class instance
$form = new auto_form($serverlink);

//debug queries

//setting callback functions

//setting callback functions

//excluding table columns
$ex = array("ID", "username", "email", "lastname", "firstname", "gender","password");
//providing form language
$lang = array("password" => "Password");

 * Generating form

echo "<fieldset>";
echo "<legend>Delete account</legend>";

//adding custom password field
$html = "<input type='password' name='password'";
	$html .= " value='".$_POST["password"]."'";
$html .= "/>";

$form->add_custom_html($html, "password", true);
//adding class predefined validation for password
$form->add_class_validation("password", "char", true);

$form->add_custom_html("<input type='hidden' name='ID' value='2'/>", "ID", true, true);

//generating form
$form->delete_form("test_users", $ex, "", "Delete your account");
echo "</fieldset>";

Return current item: Auto form