我收到此错误。
我不应该在哪里进行更改以克服此错误。
function comment()
{
global $option;
$row=& JTable::getInstance('comment','Table');
if (!$row->bind(JRequest::get('post')))
{
echo "<script>alert('".$row->getError()."');
window.history.go(-1);
</script>\n";
exit();
}
$row->comment_date=date('Y-m-d H:i:s');
$user=& JFactory::getUser();
if ($user->_table_id)
{
$row->user_id=$user->_table_id;
}
if (!$row->store())
{
echo "<script>alert('".$row->getError()."');
window.history.go(-1);</script>\n";
exit();
}
$this->setRedirect('index.php?option='.$option.'&id'.$row->review_id.'&view=review','Comment Added.');
}
提前谢谢
戴夫
答案 0 :(得分:1)
显然它无法实例化JRequest::get('post')
对象。可能这个静态函数返回NULL。
尝试以下方法:
$testObj = JRequest::get('post');
var_dump($testObj);
看看你会得到什么。