コード例 #1
0
ファイル: PHPWS_Core.php プロジェクト: HaldunA/phpwebsite
 /**
  * Checks to see if the currently post is in the LastPost
  * session. If so, it returns true. Function can be used to
  * prevent double posts.
  * If return_count is true, it returns the number of attempts
  * made with the same post.
  * @deprecate
  */
 public static function isPosted($return_count = false)
 {
     if (!isset($_SESSION['PHPWS_LastPost']) || !isset($_POST)) {
         return false;
     }
     $key = PHPWS_Core::_getPostKey();
     if (!isset($_SESSION['PHPWS_Post_Count'])) {
         $_SESSION['PHPWS_Post_Count'][$key] = 1;
     }
     $result = in_array($key, $_SESSION['PHPWS_LastPost']);
     if ($result && $return_count) {
         return $_SESSION['PHPWS_Post_Count'][$key];
     } else {
         return $result;
     }
 }