Go to the source code of this file.
Functions | |
| form_header ($action, $form_id=false, $method="post", $extra=false) | |
| form_input ($type, $name, $value="") | |
| form_submit ($text=false, $submit_name="update") | |
| form_footer ($text=false, $submit_name="update") | |
| form_check ($form_id) | |
| form_clean ($form_id) | |
|
|
Definition at line 88 of file form.php. References db_numrows(), and db_query(). Referenced by register_valid(). 00089 { 00090 if (user_getid() == 0 && 00091 (strspn($form_id, "abcdefghijklmnopqrstuvwxyz0123456789") != strlen($form_id))) 00092 { 00093 fb(_("Unrecognized unique form_id"), 1); 00094 return 0; 00095 } 00096 00097 if (db_numrows(db_query("SELECT form_id FROM form WHERE user_id='".user_getid()."' AND form_id='".addslashes($form_id)."'")) < 1) 00098 { 00099 fb(_("Duplicate Post: this form was already submitted."),1); 00100 return 0; 00101 } 00102 00103 return 1; 00104 }
|
|
|
Definition at line 107 of file form.php. References $success, db_affected_rows(), db_query(), and safeinput(). Referenced by register_valid(). 00108 { 00109 $success = db_affected_rows(db_query("DELETE FROM form WHERE user_id='".user_getid()."' AND form_id='".safeinput($form_id)."'")); 00110 if (!$success) 00111 { fb(_("Error during unique form_id removal"), 1); } 00112 00113 return $success; 00114 }
|
|
||||||||||||
|
Definition at line 72 of file form.php. References form. Referenced by conf_form(). 00073 { 00074 return ' 00075 <div class="center"> 00076 '.form_submit($text, $submit_name).' 00077 </div> 00078 </form>'; 00079 00080 }
|
|
||||||||||||||||||||
|
Definition at line 30 of file form.php. References $form_id, $result, db_affected_rows(), db_query(), form, and form_input(). 00031 { 00032 if ($extra) 00033 { $extra = " $extra"; }; 00034 00035 # Keep previous form id, in case of form that are recreated on failure 00036 if (!$form_id) 00037 { 00038 mt_srand((double)microtime()*1000000); 00039 $form_id=md5(mt_rand(0,1000000)); 00040 } 00041 $result = db_query("INSERT INTO form (form_id,timestamp,user_id) VALUES ('$form_id','".time()."','".user_getid()."')"); 00042 if (db_affected_rows($result) != 1) 00043 { fb(_("System error while creating the form, report it to admins"), 1); } 00044 00045 return ' 00046 <form action="'.$action.'" method="'.$method.'"'.$extra.'>'.form_input("hidden","form_id",$form_id); 00047 00048 }
|
|
||||||||||||||||
|
Definition at line 51 of file form.php. References $value. Referenced by form_header(), and form_submit(). 00052 { 00053 if ($value != "") 00054 { $value = 'value="'.$value.'"'; } 00055 return ' 00056 <input type="'.$type.'" name="'.$name.'" '.$value.' />'; 00057 00058 }
|
|
||||||||||||
|
Definition at line 61 of file form.php. References form_input(). 00062 { 00063 if (!$text) 00064 { $text = _("Submit"); } 00065 00066 return form_input("submit", $submit_name, $text); 00067 00068 00069 }
|
1.4.4