gaoke 发表于 2015-8-28 09:55:39

PHP action

<form name="form" id="form" method="post" action="">
                            <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="80" height="34" align="right" class="message_labes">产品搜索:&nbsp;</td>
                              <td width="80" height="34" align="right" class="message_labes">
                                    <select name="year" id="year">
                                    <?php
                                        $Y=date('Y');
                                        for(;$Y>2008;$Y--)
                                          echo '<option value="'.$Y.'">'.$Y.'</option>';
                                    ?>   
                                    </select></td>
                              <td width="80" height="34" align="right" class="message_labes">
                                    <select name="month" id="month">
                                    <?php
                                        for($i=1;$i<13;$i++)
                                          echo '<option value="'.$i.'">'.$i.'</option>';
                                    ?>   
                                    </select></td>
                              <td><input name="newstitle" type="text" id="newstitle" class="message_input" /></td>
                            </tr>
                            <tr>
                              <td colspan="2"><div class="msg_btn_area"> <a href="#">提 交</a>
                                    <input name="action" type="hidden" id="action" value="add" />
                              </div></td>
                            </tr>
                            </table>
                            <input type="hidden" name="action" id="action" value="add" />
                        </form>
  
因为action=""所以提交后就刷新本页面,适用于在一个页面同时添加搜索栏和搜索结果栏,要用session
页: [1]
查看完整版本: PHP action