任何人都可以帮我修复这里的错误我试图通过PHP脚本使页面可编辑。如果有人知道如何做到这一点或解决这个问题,请帮助我,我的代码在这里:
我收到的错误是:解析错误:语法错误,第28行/home/goaerox/public_html/monthadmin.php中的意外'of'(T_STRING)
public function editAction(){ // Create an instance of form than read .phtml file and set content $file_path = APPLICATION_PATH.”potm”.html; $file_content = file_get_contents($file_path); $this->view->form = new Admin_Form_LandingPage(); $this->view->form->setDefaults(array('landing_page' => $file_content)); // Check if we have permission to edit file if(!is_writable($file_path)){ $this->view->form->landing_page->setAttrib('disabled', 'disabled'); $this->view->form->save->setAttrib('disabled', 'disabled'); My_Utilities::fmsg("You need to set <b>write permission(777)</b> for file $file_path.", 'error'); return; } // Write/Override existing .html page if($this->_request->isPost() && $this->view->form->isValid($_POST)){ file_put_contents($file_path, $this->view->form->getValue('landing_page')); My_Utilities::fmsg(‘Partner of the Month has saved successfully.'); } } }
答案 0 :(得分:0)
声明:
$file_path = APPLICATION_PATH.”potm”.html;
看起来错了也许你的意思是:
$file_path = APPLICATION_PATH . $potm . ".html";