<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # PHP 表單驗證 - 完成表單實例 **本節展示如何在用戶提交表單后保留輸入字段中的值。** ## PHP - 保留表單中的值 如需在用戶點擊提交按鈕后在輸入字段中顯示值,我們在以下輸入字段的 value 屬性中增加了一小段 PHP 腳本:name、email 以及 website。在 comment 文本框字段中,我們把腳本放到了 &lt;textarea&gt; 與 &lt;/textarea&gt; 之間。這些腳本輸出 $name、$email、$website 和 $comment 變量的值。 然后,我們還需要顯示選中了哪個單選按鈕。對此,我們必須操作 checked 屬性(而非單選按鈕的 value 屬性): ``` Name: <input type="text" name="name" value="<?php echo $name;?>"> E-mail: <input type="text" name="email" value="<?php echo $email;?>"> Website: <input type="text" name="website" value="<?php echo $website;?>"> Comment: <textarea name="comment" rows="5" cols="40"><?php echo $comment;?></textarea> Gender: <input type="radio" name="gender" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female">Female <input type="radio" name="gender" <?php if (isset($gender) && $gender=="male") echo "checked";?> value="male">Male ``` ## PHP - 完整的表單實例 下面是 PHP 表單驗證實例的完整代碼: ### 實例 ``` <h2>PHP 表單驗證實例</h2> <p><span class="error">* 必填字段</span></p> <form method="post" action="/demo/demo_form_validation_complete.php"> 姓名: <input type="text" name="name" value=""> <span class="error">* </span> <br><br> 電郵: <input type="text" name="email" value=""> <span class="error">* </span> <br><br> 網址: <input type="text" name="website" value=""> <span class="error"></span> <br><br> <label> 評論: <textarea name="comment" rows="5" cols="40"></textarea> <br><br> 性別: <input type="radio" name="gender" value="female">女性 <input type="radio" name="gender" value="male">男性 <span class="error">* </span> <br><br> <input type="submit" name="submit" value="提交"> </form> <h2>您的輸入:</h2> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看