Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // validate editable fields
- $editable_fields = array("customerid"=>"is_int",
- "project"=>"is_string",
- "fixedquote"=>"is_string",
- "quoteamount"=>"is_numeric",
- "quotehours"=>"is_int",
- "active"=>"is_int");
- // is it an editable field?
- if (isset($editable_fields[$_POST['field']])) {
- // is the value valid?
- if (eval("return ".$editable_fields[$_POST['field']]."('".addslashes($_POST['value'])."');")) {
- /* ... do stuff ... */
- } else {
- /* error about not being the right type of data */
- }
- } else {
- /* error about not being an editable field */
- }
Advertisement
Add Comment
Please, Sign In to add comment