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


PHP fRequest::set方法代码示例

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


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

示例1: testSetArrayOverrideScalar

 public function testSetArrayOverrideScalar()
 {
     $_GET = array('user' => array('name' => 'John Smith', 'email' => 'john@smith.com'));
     fRequest::set('user[name][first]', 'John');
     $this->assertEquals(array('user' => array('name' => array('first' => 'John'), 'email' => 'john@smith.com')), $_GET);
 }
开发者ID:nurulimamnotes,项目名称:flourish-old,代码行数:6,代码来源:fRequestTest.php

示例2: str_replace

<?php

$page = 'addcard';
require 'header.php';
if ($user) {
    fSession::destroy();
    fURL::redirect();
}
if (isset($_POST['submit'])) {
    try {
        fRequest::validateCSRFToken($_POST['token']);
        // Strip colons from uid (easier to copy paste from some NFC
        // reader apps).
        fRequest::set('uid', str_replace(':', '', fRequest::get('uid')));
        $validator = new fValidation();
        $validator->addRequiredFields('password', 'email', 'uid');
        $validator->addEmailFields('email');
        $validator->addRegexRule('uid', '#^[0-9a-fA-F]+$#', 'Not in hex format');
        $validator->validate();
        $uid = strtoupper($_POST['uid']);
        if ($uid == '21222324') {
            /* New Visa cards return this, presumably for privacy */
            throw new fValidationException('Non-unique UID. This card cannot be added to the system.');
        }
        // Random IDs are 4 bytes long and start with 0x08
        // http://www.nxp.com/documents/application_note/AN10927.pdf
        if (strlen($uid) === 8 && substr($uid, 0, 2) === "08") {
            throw new fValidationException('ID is randomly generated and will change every time the card is used!');
        }
        if (strlen($uid) === 8 && substr($uid, 0, 2) === "88") {
            throw new fValidationException('Card UID\'s can\'t start with 88');
开发者ID:increpare,项目名称:hackspace-foundation-sites,代码行数:31,代码来源:login_and_addcard.php


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