quick_form($value = 'CURRENT', $separator = ': ', $divider = "<br>\n")

Creates a quick form to add or update an object. Works with linked tables as well.

$value can be 'CURRENT', 'POST', or 'GET'. This will put default values in the form based on the current values of the class, or current values of the POST or GET array (e.g. $_POST['person'])

$separator is what goes between the label and the form element

$divider is what goes after each form element

return $string

Example:

example.php
<?php
include("lib.php");
load("person");

$p = new person;
echo 
"<form method=POST action=example.php>
<table>
 <tr><td>"
;
$p->quick_form('POST'': </td><td>''</td></tr>\n <tr><td>');
echo 
"</td></tr>
</table>
<input type=submit value=Add>
</form>"
;

?>

OUTPUTS:

<form method=post action=example.php>
<table>
 <tr><td valign=top>Name: </td><td valign=top><input type="text" name="person[name]" id="name" value="" size="20" maxlength="20" ></td></tr>
 <tr><td valign=top>Address: </td><td valign=top><input type="text" name="person[address]" id="address" value="" size="50" maxlength="50" ></td></tr>
 <tr><td valign=top>City: </td><td valign=top><input type="text" name="person[city]" id="city" value="" size="30" maxlength="30" ></td></tr>
 <tr><td valign=top>Zip: </td><td valign=top><input type="text" name="person[zip]" id="zip" value="" size="9" maxlength="9" ></td></tr>
 <tr><td valign=top>Phone: </td><td valign=top><input type="text" name="person[phone]" id="phone" value="" size="14" maxlength="14" ></td></tr>
 <tr><td valign=top>Email: </td><td valign=top><input type="text" name="person[email]" id="email" value="" size="50" maxlength="50" ></td></tr>

 <tr><td valign=top>Age: </td><td valign=top><input type="text" name="person[age]" id="age" value="" size="" maxlength="" ></td></tr>
 <tr><td valign=top>Birthdate: </td><td valign=top><input type="text" name="person[birthdate]" id="birthdate" value="" size="" maxlength="" ></td></tr>
 <tr><td valign=top>Occupation: </td><td valign=top>
    <select name="person[occupation_id]" id="occupation_id" >
    <option value="" selected>[Select One]</option>
    <option value="3">Cab Driver</option>
    <option value="1">Cook</option>
    <option value="5">Cop</option>
    <option value="2">Dentist</option>
    <option value="4">Doctor</option>
    </select>
  </td></tr>
 <tr><td valign=top>Salary: </td><td valign=top><input type="text" name="person[salary]" id="salary" value="" size="" maxlength="" ></td></tr>
 <tr><td valign=top>Business: </td><td valign=top>
    <select name="person[person_has_business_lookup][]" id="person_has_business_lookup" multiple size=10>
    <option value="4">Installs</option>
    <option value="1">Networking</option>
    <option value="2">Programming</option>
    <option value="3">Troubleshooting</option>
    </select>
  </td></tr>
 <tr><td valign=top></td></tr>
</table>
<input type=submit value=Add>
</form>