我编写了这个片段,但问题是进程函数在 quickform2 中被取代,我想知道如何处理新类 quickform2 中的任何函数
session_start();
require("db.php");
require_once("HTML/QuickForm2.php");
$form=new HTML_QuickForm2('myform');
$form->addDataSource(new Html_QuickForm2_Datasource_Array(array('subject'=>'mohamed amin')));
$catsql=mysql_query("select id,category from categories order by category");
while($catrow=mysql_fetch_assoc($catsql)){
$catarr[$catrow['id']]= $catrow['category'];
}
$select= $form->addElement('select','cat_id',array('size' => 3),array('label' => 'Test Select:','options' => $catarr));
$subject=$form->addElement('text','subject',array('size'=>50,'maxlength'=>80))->setLabel('عنوان الموضوع');
$body=$form->addElement('textarea','body',array('rows'=>20,'cols'=>80))->setLabel('نص الموضوع');
$submit=$form->addElement('submit',null,array('value'=>'تنفيذ'));
$subject->addFilter('trim');
$subject->addRule('required','من فضلك ادخل عنوان للموضوع');
$body->addRule('required','مطلوب كتابة موضوع');
if($form->validate()){
$form->toggleFrozen(true);
$insertid=mysql_insert_id();
error_reporting(E_ALL);
$form->process(process_data,false);
header("Loaction:".$base_dir."viewstory.php?id=".$insertid);
}
else {
echo $form;
}
function process_data($values){
$date=date("d/m/y h:i:s");
$sql=mysql_query("insert into articles(cat_id,user_id,date,subject,body) values (".$values['cat_id'].",".$SESSION_['SESS_userID'].",".$date.",".$values['subject'].",".$values['body'].")");
我查看了文档,但找不到与迁移此功能相关的任何内容}