zoukankan      html  css  js  c++  java
  • PHP表单的提交,以及表单元素的HTML语法

    <?php // formtest2.php
    if (isset($_POST['name'])) $name = $_POST['name'];
    else $name = "(Not entered)";
    
    echo <<<_END
    <html>
        <head>
            <title>Form Test</title>
        </head>
        <body>
        Your name is: $name<br />
        <form method="post" action="formtest.php">
            What is your name?
            <input type="text" name="name" />
            <input type="submit" />
        </form>
        </body>
    </html>
    _END;
    ?>
    
    <form method="post" action="calc.php"><pre>
          Loan Amount <input type="text" name="principle" />
    Monthly Repayment <input type="text" name="monthly" />
      Number of Years <input type="text" name="years" value="25" />
        Interest Rate <input type="text" name="rate" value="6" />
                      <input type="submit" />
    </pre></form>
    
       Vanilla <input type="checkbox" name="ice" value="Vanilla" />
     Chocolate <input type="checkbox" name="ice" value="Chocolate" />
    Strawberry <input type="checkbox" name="ice" value="Strawberry" />
    
       Vanilla <input type="checkbox" name="ice[]" value="Vanilla" />
     Chocolate <input type="checkbox" name="ice[]" value="Chocolate" />
    Strawberry <input type="checkbox" name="ice[]" value="Strawberry" />
    
    8am-Noon<input type="radio" name="time" value="1" />|
    Noon-4pm<input type="radio" name="time" value="2" checked="checked"/>|
     4pm-8pm<input type="radio" name="time" value="3" />
     
     Vegetables <select name="veg" size="1">
    <option value="Peas">Peas</option>
    <option value="Beans">Beans</option>
    <option value="Carrots">Carrots</option>
    <option value="Cabbage">Cabbage</option>
    <option value="Broccoli">Broccoli</option>
    </select>
    
    
    Vegetables <select name="veg" size="5" multiple="multiple">
    <option value="Peas">Peas</option>
    <option value="Beans">Beans</option>
    <option value="Carrots">Carrots</option>
    <option value="Cabbage">Cabbage</option>
    <option value="Broccoli">Broccoli</option>
    </select>
  • 相关阅读:
    Java之美[从菜鸟到高手演变]之设计模式
    常见JAVA框架
    每周一荐:学习ACE一定要看的书
    YUV格式&像素
    关于makefile
    socket通信
    [理论篇]一.JavaScript中的死连接`javascript:void(0)`和空连接`javascript:;`
    [应用篇]第三篇 JSP 标准标签库(JSTL)总结
    [应用篇]第一篇 EL表达式入门
    KVM基本实现原理
  • 原文地址:https://www.cnblogs.com/findumars/p/2910628.html
Copyright © 2011-2022 走看看