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


PHP input_text函数代码示例

本文整理汇总了PHP中input_text函数的典型用法代码示例。如果您正苦于以下问题:PHP input_text函数的具体用法?PHP input_text怎么用?PHP input_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: show_form

function show_form($errors = '')
{
    global $products;
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    if ($errors) {
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // Build up an array of defaults if there is an order saved
    // in the session
    if ($_SESSION['saved_order']) {
        $defaults = array();
        foreach ($products as $product => $description) {
            $defaults["dish_{$product}"] = $_SESSION["dish_{$product}"];
        }
    } else {
        $defaults = $_POST;
    }
    foreach ($products as $product => $description) {
        input_text("dish_{$product}", $defaults);
        print " {$description}<br/>";
    }
    input_submit('submit', 'Order');
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
开发者ID:Higashi0809,项目名称:php,代码行数:27,代码来源:answer-8-4.php

示例2: show_form

function show_form($errors = '')
{
    // If the form is submitted, get defaults from submitted parameters
    if (array_key_exists('_submit_check', $_POST)) {
        $defaults = $_POST;
        var_dump($defaults);
    } else {
        // Otherwise, set our own defaults: price is $5
        $defaults = array('price' => '5.00', 'dish_name' => '', 'is_spicy' => 'no');
    }
    // If errors were passed in, put them in $error_text (with HTML markup)
    if (is_array($errors)) {
        $error_text = '<tr><td>You need to correct the following errors:';
        $error_text .= '</td><td><ul><li>';
        $error_text .= implode('</li><li>', $errors);
        $error_text .= '</li></ul></td></tr>';
    } else {
        // No errors? Then $error_text is blank
        $error_text = '';
    }
    // Jump out of PHP mode to make displaying all the HTML tags easier
    ?>
<form method="POST" action="<?php 
    print $_SERVER['PHP_SELF'];
    ?>
">
<table>
<?php 
    print $error_text;
    ?>

<tr><td>Dish Name:</td>
<td><?php 
    input_text('dish_name', $defaults);
    ?>
</td></tr>

<tr><td>Price:</td>
<td><?php 
    input_text('price', $defaults);
    ?>
</td></tr>

<tr><td>Spicy:</td>
<td><?php 
    input_radiocheck('checkbox', 'is_spicy', $defaults, 'yes');
    ?>
 Yes</td></tr>

<tr><td colspan="2" align="center"><?php 
    input_submit('save', 'Order');
    ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php 
}
开发者ID:KimiyukiYamauchi,项目名称:php.2015,代码行数:59,代码来源:example-7-30.php

示例3: show_form

function show_form($errors = '')
{
    global $dish_names;
    // If the form is submitted, get defaults from submitted variables
    if ($_POST['_submit_check']) {
        $defaults = $_POST;
    } else {
        // Otherwise, no defaults
        $defaults = array();
    }
    // If errors were passed in, put them in $error_text (with HTML markup)
    if ($errors) {
        $error_text = '<tr><td>You need to correct the following errors:';
        $error_text .= '</td><td><ul><li>';
        $error_text .= implode('</li><li>', $errors);
        $error_text .= '</li></ul></td></tr>';
    } else {
        // No errors? Then $error_text is blank
        $error_text = '';
    }
    // Jump out of PHP mode to make displaying all the HTML tags easier
    ?>
<form method="POST" action="<?php 
    print $_SERVER['PHP_SELF'];
    ?>
">
<table>
<?php 
    print $error_text;
    ?>

<tr><td>Customer Name:</td>
<td><?php 
    input_text('customer_name', $defaults);
    ?>
</td></tr>

<tr><td>Phone Number:</td>
<td><?php 
    input_text('phone', $defaults);
    ?>
</td></tr>

<tr><td>Favorite Dish:</td>
<td><?php 
    input_select('favorite_dish_id', $defaults, $dish_names);
    ?>
</td></tr>

<tr><td colspan="2" align="center"><?php 
    input_submit('save', 'Add Customer');
    ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php 
}
开发者ID:Higashi0809,项目名称:php,代码行数:59,代码来源:answer-7-4.php

示例4: show_form

function show_form($errors = '')
{
    if ($errors) {
        print 'You need to correct the following errors: <ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // the beginning of the form
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    print '<table>';
    // the first address
    print '<tr><th colspan="2">From</th></tr>';
    print '<td>Name:</td><td>';
    input_text('name_1', $_POST);
    print '</td></tr>';
    print '<tr><td>Street Address:</td><td>';
    input_text('address_1', $_POST);
    print '</td></tr>';
    print '<tr><td>City, State, Zip:</td><td>';
    input_text('city_1', $_POST);
    print ', ';
    input_select('state_1', $_POST, $GLOBALS['us_states']);
    input_text('zip_1', $_POST);
    print '</td></tr>';
    // the second address
    print '<tr><th colspan="2">To</th></tr>';
    print '<td>Name:</td><td>';
    input_text('name_2', $_POST);
    print '</td></tr>';
    print '<tr><td>Street Address:</td><td>';
    input_text('address_2', $_POST);
    print '</td></tr>';
    print '<tr><td>City, State, Zip:</td><td>';
    input_text('city_2', $_POST);
    print ', ';
    input_select('state_2', $_POST, $GLOBALS['us_states']);
    input_text('zip_2', $_POST);
    print '</td></tr>';
    // Package Info
    print '<tr><th colspan="2">Package</th></tr>';
    print '<tr><td>Height:</td><td>';
    input_text('height', $_POST);
    print '</td></tr>';
    print '<tr><td>Width:</td><td>';
    input_text('width', $_POST);
    print '</td></tr>';
    print '<tr><td>Length:</td><td>';
    input_text('length', $_POST);
    print '</td></tr>';
    print '<tr><td>Weight:</td><td>';
    input_text('weight', $_POST);
    print '</td></tr>';
    // form end
    print '<tr><td colspan="2"><input type="submit" value="Ship Package"></td></tr>';
    print '</table>';
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
开发者ID:Higashi0809,项目名称:php,代码行数:58,代码来源:answer-6-4.php

示例5: show_form

function show_form($errors = '')
{
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    if ($errors) {
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    print 'Username: ';
    input_text('username', $_POST);
    print '<br/>';
    print 'Password: ';
    input_password('password', $_POST);
    print '<br/>';
    input_submit('submit', 'Log In');
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
开发者ID:jmyroup,项目名称:uci_projects,代码行数:18,代码来源:login.php

示例6: show_form

function show_form($errors = '')
{
    if ($errors) {
        print 'You need to correct the following errors: <ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // the beginning of the form
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    print '<table>';
    // the search term
    print '<tr><td>Search Term:</td><td>';
    input_text('term', $_POST);
    print '</td></tr>';
    // form end
    print '<tr><td colspan="2"><input type="submit" value="Search News Feed"></td></tr>';
    print '</table>';
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
开发者ID:Higashi0809,项目名称:php,代码行数:20,代码来源:answer-11-4.php

示例7: show_form

function show_form($errors = '')
{
    if ($errors) {
        print 'You need to correct the following errors: <ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // the beginning of the form
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    // the file name
    print ' File name: ';
    input_text('filename', $_POST);
    print '<br/>';
    // the submit button
    input_submit('submit', 'Show File');
    // the hidden _submit_check variable
    print '<input type="hidden" name="_submit_check" value="1"/>';
    // the end of the form
    print '</form>';
}
开发者ID:Higashi0809,项目名称:php,代码行数:20,代码来源:answer-10-4.php

示例8: show_form

function show_form($errors = '')
{
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    if ($errors) {
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // Since we're not supplying any defaults of our own, it's OK
    // to pass $_POST as the defaults array to input_select and
    // input_text so that any user-entered values are preserved
    print 'Dish: ';
    input_select('dish', $_POST, $GLOBALS['main_dishes']);
    print '<br/>';
    print 'Quantity: ';
    input_text('quantity', $_POST);
    print '<br/>';
    input_submit('submit', 'Order');
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
开发者ID:e15007,项目名称:php2,代码行数:21,代码来源:example-8-10.php

示例9: foreach

                             <div class="portlet-body">
                                 
                                 <form id="form_editar" class="form-horizontal form-row-seperated" name="nuevo" action='procesa_datos_editar.php?tipo=<?php 
echo $_GET['tipo'];
?>
&id=<?php 
echo $_GET['id'];
?>
' method="post">
                                    
                                    <?php 
foreach ($inputs as $key => $value) {
    if ($key == 'pass') {
        echo input_password($value);
    } else {
        echo input_text($value);
    }
}
?>

                                    <div class="form-actions">
                                        <div class="row">
                                            <div class="col-lg-offset-10 col-lg-2 col-sm-offset-8 col-sm-4">
                                                <button type="submit" class="btn green button-submit"> <?php 
echo _('Guardar');
?>
 <i class="fa fa-arrow-circle-right"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    
开发者ID:bcgarcia,项目名称:WGNOV14,代码行数:30,代码来源:editar_usuarios.php

示例10: insertCreateUserForm

function insertCreateUserForm($w, $ds)
{
    list($userid, $userdescrip, $useremail, $grp) = myRegister("S:userid S:userdescrip S:useremail S:grp");
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, hidden(array("name" => "action", "value" => "parsecreateuserform")));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Create new user")));
    insert($con, textbr(my_("User-id (case sensitive!):")));
    insert($con, input_text(array("name" => "userid", "value" => "{$userid}", "size" => "20", "maxlength" => "40")));
    insert($con, textbrbr(my_("User's fullname:")));
    insert($con, input_text(array("name" => "userdescrip", "value" => "{$userdescrip}", "size" => "40", "maxlength" => "80")));
    insert($con, textbrbr(my_("User's e-mail:")));
    insert($con, input_text(array("name" => "useremail", "value" => "{$useremail}", "size" => "40", "maxlength" => "64")));
    if (AUTH_INTERNAL) {
        insert($con, textbrbr(my_("Password (case sensitive!):")));
        insert($con, password(array("name" => "password1", "size" => "20", "maxlength" => "40")));
        insert($con, textbrbr(my_("Password (again):")));
        insert($con, password(array("name" => "password2", "size" => "20", "maxlength" => "40")));
    }
    $result2 = $ds->GetGrps();
    $lst = array("" => "No group");
    while ($row = $result2->FetchRow()) {
        $col = $row["grp"];
        $lst["{$col}"] = $row["grp"] . " - " . $row["grpdescrip"];
    }
    insert($con, textbrbr(my_("Group")));
    insert($con, selectbox($lst, array("name" => "grp"), $grp));
    insert($f, generic("br"));
    insert($f, submit(array("value" => my_("Create User"))));
    insert($f, freset(array("value" => my_("Clear"))));
}
开发者ID:hetznerZA,项目名称:ipplan,代码行数:32,代码来源:usermanager.php

示例11: insert

insert($w, block("</h3>"));
// start form
insert($w, $f = form(array("name" => "MODIFY", "method" => "post", "action" => "displaysubnet.php")));
myFocus($p, "MODIFY", "user");
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("User information")));
insert($con, textbr(my_("User")));
insert($con, input_text(array("name" => "user", "size" => "80", "maxlength" => "80")));
insert($con, block(" <a href='#' onclick='MODIFY.user.value=\"" . DHCPRESERVED . "\";'>" . my_("DHCP address") . "</a>"));
insert($con, textbrbr(my_("Location")));
insert($con, input_text(array("name" => "location", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device description")));
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Telephone number")));
insert($con, input_text(array("name" => "telno", "size" => "15", "maxlength" => "15")));
insert($con, hidden(array("name" => "baseindex", "value" => $baseindex)));
insert($con, hidden(array("name" => "block", "value" => $block)));
insert($con, hidden(array("name" => "search", "value" => $search)));
insert($con, hidden(array("name" => "expr", "value" => "{$expr}")));
$cnt = 0;
foreach ($ip as $value) {
    insert($con, hidden(array("name" => "ip[" . $cnt++ . "]", "value" => "{$value}")));
}
insert($con, hidden(array("name" => "md5str", "value" => "{$md5str}")));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
// start form for delete
// all info will be blank, thus record will be deleted
$settings = array("name" => "DELETE", "method" => "post", "action" => "displaysubnet.php");
if ($ipplanParanoid) {
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:modifyipformmul.php

示例12: insert

insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
// ugly kludge with global variable!
$displayall = TRUE;
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
$areaindex = myAreaDropDown($ds, $f1, $cust, $areaindex);
insert($w, $f2 = form(array("name" => "ENTRY", "method" => "get", "action" => "findfree.php")));
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
myRangeDropDown($ds, $f2, $cust, $areaindex);
insert($f2, block("<p>"));
insert($f2, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
insert($con, textbr(my_("IP range start (leave blank if range selected)")));
insert($con, input_text(array("name" => "start", "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("IP range end (leave blank if range selected)")));
insert($con, input_text(array("name" => "end", "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("Display only subnets between these sizes")));
insert($con, span(my_("Minimum"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "size_from", "size" => "5", "maxlength" => "6")));
insert($con, span(my_("Maximum"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "size_to", "size" => "5", "maxlength" => "6")));
insert($con, textbrbr(my_("Show filter")));
insert($con, radio(array("name" => "showused", "value" => "0"), my_("Free and Unassigned")));
insert($con, radio(array("name" => "showused", "value" => "2"), my_("Unassigned only")));
insert($con, radio(array("name" => "showused", "value" => "1"), my_("All"), "checked"));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPfindfreeform", "ENTRY");
printhtml($p);
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:findfreeform.php

示例13: DisplayTemplate

 function DisplayTemplate(&$layout)
 {
     //echo "<pre>";var_dump($this->userfld);echo "</pre>";
     foreach ($this->userfld as $field => $val) {
         insert($layout, textbr());
         insert($layout, text($this->userfld["{$field}"]["descrip"]));
         insert($layout, textbr());
         // "name" definition looks strange, but associative arrays
         // in html must not have quotes, something like
         // userfld[fieldname] which will be correctly converted by php
         if ($this->userfld["{$field}"]["type"] == "C") {
             insert($layout, input_text(array("name" => "userfld[{$field}]", "value" => isset($this->userfld["{$field}"]["value"]) ? $this->userfld["{$field}"]["value"] : $this->userfld["{$field}"]["default"], "size" => $this->userfld["{$field}"]["size"], "maxlength" => $this->userfld["{$field}"]["maxlength"])));
         } elseif ($this->userfld["{$field}"]["type"] == "T") {
             insert($layout, textarea(array("name" => "userfld[{$field}]", "cols" => $this->userfld["{$field}"]["size"], "rows" => $this->userfld["{$field}"]["rows"], "maxlength" => $this->userfld["{$field}"]["maxlength"]), isset($this->userfld["{$field}"]["value"]) ? $this->userfld["{$field}"]["value"] : $this->userfld["{$field}"]["default"]));
         } elseif ($this->userfld["{$field}"]["type"] == "S") {
             insert($layout, selectbox($this->userfld["{$field}"]["select"], array("name" => "userfld[{$field}]"), isset($this->userfld["{$field}"]["value"]) ? $this->userfld["{$field}"]["value"] : $this->userfld["{$field}"]["default"]));
         }
         /*
         elseif ($this->userfld["$field"]["type"] == "B") {
             insert($layout,checkbox(array("name"=>"userfld[$field]",
                             "value"=>isset($this->userfld["$field"]["value"]) ? $this->userfld["$field"]["value"] : $this->userfld["$field"]["default"]), "Text"));
         
         }
         */
     }
 }
开发者ID:hetznerZA,项目名称:ipplan,代码行数:26,代码来源:class.templib.php

示例14: input_text

echo "<br/>";
echo input_text(["id" => "'apellido_paterno'"], ["class" => "'label'"], "Apellido Paterno:");
echo input_text(["id" => "'apellido_materno'"], ["class" => "'label'"], "Apellido Materno:");
echo "<br/>";
echo "<div class='label' id='fech'>Fecha Nacimiento:</div>";
echo "<label id='d'>Día:</label>";
echo "<input type='text' class='fecha' id='dia'>";
echo "<label id='m'>Mes:</label>";
echo "<input type='text' class='fecha' id='mes'> ";
echo "<label id='a'>Año:</label>";
echo "<input type='text' class='fecha' id='año'>";
echo "<label id='ed'>Edad:</label>";
echo "<input type='text' id='edad'>";
echo "<br/>";
echo input_text(["id" => "'telefono'"], ["class" => "'label'"], "Teléfono:");
echo input_text(["id" => "'mail'"], ["class" => "'label'"], "Mail:");
echo "<br/>";
$result = DbExecuteQuerys("Select id_prevision,nombre From prevision;");
echo "<div class='label'>Prevision:</div>";
echo "<select id='prevision'>";
echo "<option value='0'>-----------</option>";
while ($datos = mysqli_fetch_array($result)) {
    $valor_id = $datos['id_prevision'];
    $valor = $datos['nombre'];
    echo "<option value='{$valor_id}'>" . $valor . "</option>";
}
echo "</select>";
echo "<div class='label'>Estado Civil:</div>";
echo "<select id='estado_civil'>";
echo "<option value='0'>-----------</option>";
echo "<option value='casada'>CASADA</option>";
开发者ID:SiriLivtar,项目名称:SFC,代码行数:31,代码来源:form.php

示例15: input_text

<?php

include '../general.php';
include_once 'ChromePhp.php';
//ChromePhp::Log("<a href='".RAIZ_HTML."/roles/anonimo/crear_ficha'>Crea Cuenta</a>");
echo "<div id='contenedor-centrado'>";
echo "<div class='titulo-contenedor'>Ingreso Usuario</div>";
echo input_text(["id" => "'usuario'"], ["class" => "'label'"], "RUT:");
echo "<br/>";
echo "<div class='label'>Contraseña:</div>";
echo "<input type='password' id='contraseña'>";
echo "<br/>";
//separador
echo "<div class='separador'></div>";
echo "<input type='button' id='ingreso' value='Ingresar'> ";
echo "</div>";
echo "</div>";
开发者ID:SiriLivtar,项目名称:SFC,代码行数:17,代码来源:form.php


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