当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseController::processPost方法代码示例

本文整理汇总了PHP中BaseController::processPost方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseController::processPost方法的具体用法?PHP BaseController::processPost怎么用?PHP BaseController::processPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseController的用法示例。


在下文中一共展示了BaseController::processPost方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processPost

 public function processPost()
 {
     parent::processPost();
     copyArray($_POST, $fv, 'postId', 'title', 'content');
     $dao = DAO::getDAO('PostDAO');
     $dao->update("title = '{$fv['title']}', content = '{$fv['content']}' WHERE postId = {$fv['postId']}");
 }
开发者ID:renduples,项目名称:alibtob,代码行数:7,代码来源:BlogEdit.php

示例2: processPost

	public function processPost()
	{		
		parent::processPost();

		copyArray($_POST, $fv, 'postId', 'title', 'content');
		$dao = DAO::getDAO('PostDAO');
		$dao->update("title = '$fv[title]', content = '$fv[content]' WHERE postId = $fv[postId]");
	}
开发者ID:ngduc,项目名称:Thin-PHP-Framework,代码行数:8,代码来源:BlogEdit.php

示例3: processPost

	public function processPost()
	{		
		parent::processPost();

		copyArray($_POST, $fv, 'itemId', 'replyToId', 'name', 'email', 'content', 'parentCommentWeight');
		$dao = DAO::getDAO('CommentDAO');

		// #TODO: validate here...
		if (trim($fv['content']) != '')
		{
			$parentW = $fv['parentCommentWeight'];
			
			$dbNow = date( 'Y-m-d H:i:s' );
			$newComment = new Comment(
								array('type' => 1, 'itemId' => $fv['itemId'],
										'replyToId' => $fv['replyToId'],
										'authorName' => $fv['name'],
										'authorEmail' => $fv['email'],
										'content' => $fv['content'],
										'weight' => '0',
										'createTime' => $dbNow)
								);
			$err = $dao->insertInto("type, itemId, replyToId, weight, authorName, authorEmail, content, createTime", $newComment->getFields());		
			
			// update new Comment's Weight
			$weight = 0;			
			$newId = $dao->getDbHandler()->lastInsertId();			
			if ($parentW == '') {
				$weight = $newId;
			}
			else {
				if (strpos($parentW.'', '.') === false) {
					$weight = (double)($parentW.'.01');
				} else {
					$r = $dao->getLastComment($fv['replyToId']);
					if ($r == null) {	// no child comment
						$weight = $parentW.'01';
					}
					else {
						$lw = $r['weight'];		// last comment's weight, ex: 2.09				
						$floor_lw = floor($lw);	// = 2
						$sRemainder = fmod($lw, $floor_lw).''; // 2.22 % 2 = 0.09							
						$sRemainder = str_replace('0.', '1', $sRemainder); // = '109'
						$weight = $sRemainder + 1;	// = 110
						$sRemainderNew = substr($weight.'',	1); // '10'
						$weight = $floor_lw.'.'.$sRemainderNew;	// = 2.10
					}								
				}
			}			
			$dao->update('weight = ? WHERE commentId = ?', array($weight, $newId));
		}
	}
开发者ID:ngduc,项目名称:Thin-PHP-Framework,代码行数:52,代码来源:BlogComment.php

示例4: processPost

 public function processPost()
 {
     parent::processPost();
     copyArray($_POST, $fv, 'viewFile', 'jwEditor');
     $viewPath = BASEVIEW . '/' . currentViewDir() . '/' . $fv['viewFile'];
     $newContent = html_entity_decode($fv['jwEditor'], ENT_QUOTES);
     if (file_exists($viewPath)) {
         $f = fopen($viewPath, 'w');
         fwrite($f, $newContent);
         fclose($f);
     }
     header('Location: ' . $_SERVER['HTTP_REFERER']);
 }
开发者ID:renduples,项目名称:alibtob,代码行数:13,代码来源:Editor.php

示例5: processPost

 public function processPost()
 {
     parent::processPost();
     if (isset($_POST['form'])) {
         if ($_POST['form'] == 'edit') {
             BaseController::callController(BASEEXT . '/blog', 'BlogEdit', array());
         } else {
             if ($_POST['form'] == 'comment') {
                 BaseController::callController(BASEEXT . '/blog', 'BlogShow', array());
             }
         }
         header('Location: ' . $_SERVER['HTTP_REFERER']);
     }
 }
开发者ID:renduples,项目名称:alibtob,代码行数:14,代码来源:Blog.php

示例6: processPost

 public function processPost()
 {
     parent::processPost();
     // #TODO: User submitted data. Save it to DB, email, etc.
     copyArray($_POST, $fv, 'ftoken', 'name', 'email', 'optin|checkbox', 'msg');
     session_start();
     if ($fv['ftoken'] != $_SESSION['ftoken']) {
         die('Error: invalid form token! Do not submit your form twice.');
     }
     unset($_SESSION['ftoken']);
     $v = $this->smarty;
     $v->assign('title', 'Thank you!');
     $v->assign(array('name' => sanitizeString($fv['name']), 'email' => sanitizeEmail($fv['email']), 'optin' => $fv['optin']));
     $v->assign('inc_content', v('contact_us_done.html'));
     $this->display($v, v('index.html'));
 }
开发者ID:rsanaie,项目名称:Thin-PHP-Framework,代码行数:16,代码来源:ContactUs.php

示例7: processPost

 public function processPost()
 {
     parent::processPost();
     // #TODO: User submitted data. Save it to DB, email, etc.
     copyArray($_POST, $v, '*');
     $dao = DAO::getDAO('UserDAO');
     $newUser = new User(array('firstName' => 'First', 'lastName' => 'LastName', 'username' => $v['username'], 'email' => $v['email'], 'password' => $v['password'], 'createTime' => dbDateTime()));
     $ret = $dao->insertInto('firstName, lastName, username, email, password, createTime', $newUser->getFields());
     if ($ret[0] != '00000') {
         $err = "<span class='msgErr'>ERROR: {$ret['2']}</span>";
     }
     $v = $this->smarty;
     $v->assign('title', 'Thank you!');
     $v->assign('content', '<h2>Thank you!</h2><p>Thanks for your registration.</p><p>' . $err . '<p/><p><a href="/user-list">Check User List</a><p/>');
     $v->assign('inc_content', 'blank.html');
     $this->display($v, v('index.html'));
 }
开发者ID:renduples,项目名称:alibtob,代码行数:17,代码来源:Register.php

示例8: processPost

	public function processPost()
	{
		parent::processPost();
		session_start();
		// #TODO: User submitted data. Save it to DB, email, etc.
		copyArray($_POST, $fv, 'ftoken', 'name', 'email', 'optin|checkbox', 'msg');
		
		checkFormToken('ftoken_contact_us', $fv['ftoken']);		

		$v = $this->smarty;
		$v->assign('title', 'Thank you!');
		$v->assign(array(
				'name' => sanitizeString($fv['name']),
				'email' => sanitizeEmail($fv['email']),
				'optin' => $fv['optin']
		));
		$v->assign('inc_content', v('contact_us_done.html'));
		$this->display($v, v('index.html'));
	}
开发者ID:ngduc,项目名称:Thin-PHP-Framework,代码行数:19,代码来源:ContactUs.php

示例9: processPost

 public function processPost()
 {
     parent::processPost();
     copyArray($_POST, $fv, 'username', 'password');
     // #TODO: check Username & Password from DB
     if ($fv['password'] == 'demo') {
         // successfully signed in!
         $ret = session_start();
         setLoggedInUsername($fv['username']);
         header('Location: ' . $_SERVER['HTTP_REFERER']);
     } else {
         $msg = '<font color="red">Invalid Username or Password!</font><p/> <a href="javascript:history.go(-1)">Go back</a>';
         $v = $this->smarty;
         $v->assign('title', 'Contact Us');
         $v->assign('hide_signin', '1');
         // MUST hide signin, otherwise it will cause infinite loop!!!
         $v->assign('inc_content', BASEEXT . '/authentication/view/signin_msg.html');
         $v->assign('message', $msg);
         $this->display($v, v('index.html'));
     }
 }
开发者ID:renduples,项目名称:alibtob,代码行数:21,代码来源:SignIn.php


注:本文中的BaseController::processPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。