Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Ext.Ajax.request({
  2. url:'/zend/public/guestbook/sign',
  3. method: 'POST',
  4. params: {
  5. commented : arr2, datecreated : arr3
  6. })
  7.  
  8. public function signAction() {
  9.  
  10. if ($this->getRequest()->isPost()) {
  11.  
  12. $commentdata = mysql_escape_string($_POST['commented']);
  13. $dcreatedata = mysql_escape_string($_POST['datecreated']);
  14.  
  15. $formdata = array('comment' => $commentdata, 'date_created' => $dcreatedata);
  16.  
  17. $model = new Application_Model_Guestbook($formdata);
  18. $mapper = new Application_Model_GuestbookMapper();
  19. $mapper->save($model);
  20. $msg = '{success:true, result:{message:'Data Saved!'}}';
  21.  
  22. }
  23. else {
  24. http_response_code(404);
  25. $msg = '{success:false, errors:{reason:'Login failed, try again.'}}';
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement