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


PHP Forms::textBox方法代码示例

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


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

示例1: showLogin

 public function showLogin($arr = array('user' => 'Username', 'pass' => 'Password', 'login' => 'Sign in'), $invalid)
 {
     require 'Forms.php';
     # in the same directory as Login.php
     $forms = new Forms('');
     $fcnt = 1;
     # First field
     foreach ($arr as $k => $v) {
         if ($k != 'login') {
             $forms->textBox($v, $k, $fcnt == 1 && isset($_POST["txt_{$k}"]) && !empty($_POST["txt_{$k}"]) ? $_POST["txt_{$k}"] : '', 1, in_array($v, $invalid), '', 1);
             if ($fcnt == 1) {
                 $u = $v;
                 $u2 = $k;
             }
             // End if.
             if ($fcnt == 2) {
                 $p = $v;
                 $p2 = $k;
             }
             // End if.
             $fcnt++;
         }
         // End if.
     }
     // End foreach.
     $forms->submitButton(isset($arr['login']) ? $arr['login'] : 'Sign in', 'login', 1);
     echo $forms->closeform();
     unset($forms);
     $focus = '';
     if (count($invalid) || empty($_POST["txt_{$p}"])) {
         $focus = "\n<script>document.forms[0].txt_{$p2}.focus();</script>";
     }
     if ((!count($invalid) || in_array($u, $invalid)) && empty($_POST["txt_{$u2}"])) {
         $focus = "\n<script>document.forms[0].txt_{$u2}.focus();</script>";
         //$focus = "\n<script>\$(document).ready(function(){ \$('.classform input[name=txt_{$u2}]').focus(); });</script>";
     }
     // End if.
     if (!empty($focus)) {
         echo $focus;
     }
     //else  echo '<script>document.forms[0].user.focus();</script>';
 }
开发者ID:bas2,项目名称:classes,代码行数:42,代码来源:Login.php

示例2: Forms

<?php

/*
 * Adds a new subtopic record into the hcd_helpstopics table given a topic ID
 */
//ini_set('display_errors', 1);
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    require_once '../../../../../includes/classes/Forms.php';
    $forms = new Forms('');
    // , array(), 'txt_stopic'
    $forms->textBox('Enter name of new sub topic', 'stopic', '', 1, 0, '', 1);
    $forms->submitButton('New sub topic', 'stnew', 1);
    unset($forms);
} else {
    require_once '../../../../../includes/classes/Db.php';
    $link = DBCxn::get('../../../../../_db/help.php');
    $r = $link->prepare("INSERT INTO stopics (topicid,stopic,mod_datetime) VALUES(?,?,NOW())");
    $r->execute(array($_GET['topicid'], $_POST['txt_stopic']));
    if ($r->rowCount() == 1) {
        $r2 = $link->prepare("UPDATE topics SET mod_datetime=NOW() WHERE topic_id=?");
        $r2->execute(array($_GET['topicid']));
        if ($r2->rowCount() == 1) {
            header('Location: /apps/help/');
        } else {
            echo "{$_GET['topicid']}";
        }
    } else {
        echo "{$_POST['txt_stopic']}";
    }
}
// End if.
开发者ID:bas2,项目名称:help,代码行数:31,代码来源:helpstopicnew.php


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