Source for file function.uniqid.php

Documentation is available at function.uniqid.php

  1. <?php
  2. /**
  3.  *  smarty function:ユニークIDを生成する(double postチェック用)
  4.  *
  5.  *  sample:
  6.  *  <code>
  7.  *  {uniqid}
  8.  *  </code>
  9.  *  <code>
  10.  *  <input type="hidden" name="uniqid" value="a0f24f75e...e48864d3e">
  11.  *  </code>
  12.  *
  13.  *  @param  string  $type   表示タイプ("get" or "post"−デフォルト="post")
  14.  *  @see    isDuplicatePost
  15.  */
  16. function smarty_function_uniqid($params&$smarty)
  17. {
  18.     $uniqid Ethna_Util::getRandom();
  19.     if (isset($params['type']&& $params['type'== 'get'{
  20.         return "uniqid=$uniqid";
  21.     else {
  22.         return "<input type=\"hidden\" name=\"uniqid\" value=\"$uniqid\" />\n";
  23.     }
  24. }

Documentation generated on Fri, 11 Nov 2011 03:58:10 +0900 by phpDocumentor 1.4.3