PHP刚开始学习,遇到这个代码困难,不知道怎麼改。我是看著书上敲的,但是出现错误,请指教
<?phpdefined('_JEXEC')ordie('Restrictedaccess');require_once(JApplicationHelper::getP...
<?php
defined('_JEXEC')or die('Restricted access');
require_once(JApplicationHelper::getPath('admin_html'));
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
switch($task)
{
case 'add':
editComment($option);
break;
case 'save':
saveComment($option);
break;
}
function editComment($option)
{
$row=&JTable::getInstance('Comment','Table');
$lists=array();
$ranks=array(('0'=>array('value'=>'0','text'=>'好'),'1'=>array('value'=>'1'),'text'=>'一般','2'=>array('value=2','text'=>'差'));
$lists['user_id']=JHTML::_('list.users','user_id',$row->user_id,1,NULL,'name',0);
$lists['ranks']=JHTML::_('selsct.genericList',$ranks,'ranks','class-"inputbox"'.'',''value','text',$row->ranks);
$lists['published']=JHTML::_('select.booleanlist','published','class-"inputbox"',$row->published);
HTML_comments::editComment($row,$list,$option);
}
?> 展开
defined('_JEXEC')or die('Restricted access');
require_once(JApplicationHelper::getPath('admin_html'));
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
switch($task)
{
case 'add':
editComment($option);
break;
case 'save':
saveComment($option);
break;
}
function editComment($option)
{
$row=&JTable::getInstance('Comment','Table');
$lists=array();
$ranks=array(('0'=>array('value'=>'0','text'=>'好'),'1'=>array('value'=>'1'),'text'=>'一般','2'=>array('value=2','text'=>'差'));
$lists['user_id']=JHTML::_('list.users','user_id',$row->user_id,1,NULL,'name',0);
$lists['ranks']=JHTML::_('selsct.genericList',$ranks,'ranks','class-"inputbox"'.'',''value','text',$row->ranks);
$lists['published']=JHTML::_('select.booleanlist','published','class-"inputbox"',$row->published);
HTML_comments::editComment($row,$list,$option);
}
?> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询