public function msave(Request $request) { $data = new Message(); $data->title = $request->input('title'); $data->content = $request->input('content'); $data->contact = $request->input('contact'); $data->s_uid = 0; $data->r_uid = 0; $result = "留言失败"; if ($data->save()) { $result = "留言成功,稍后管理员联系您"; } return $result; }
public function postIndex() { $message = new Message(); if (Input::get('password') == 'esik') { $message['nev'] = Input::get('name'); $message['e-mail'] = Input::get('email'); $text = htmlspecialchars(Input::get('text')); $message['uzenet'] = preg_replace('/\\n/', '<br>', $text); $message['replied_to'] = Input::get('messageId'); if (!empty($message['nev'])) { $message->save(); } } return $this->getIndex(); }