提交重定向到另一个页面后

时间:2016-09-21 06:38:54

标签: javascript jquery wordpress

我在php中有提交按钮的搜索表单。 (像短码一样) 我需要在另一个页面上重定向数据。例如http://localhost/wordpress/?data_min=21.09.2016&data_max=22.09.2016和"?data_min = 21.09.2016& data_max = 22.09.2016"重定向到http://localhost/search_form/?data_min=21.09.2016&data_max=22.09.2016

<h4>
<?php        
    if ( is_category() ) {
        echo 'archives : ' . single_cat_title();
    } elseif ( is_tag() ) {
        echo single_tag_title() . ' : archives';
    } elseif ( is_author() ) {
        the_post();
        echo 'Author archives : ' . get_the_author();
        rewind_posts();
    } elseif ( is_day() ) {
        echo 'Daily archives : ' . get_the_date();
    } elseif ( is_month() ) {
        echo 'Monthly archives : ' . get_the_date('F Y');
    } elseif ( is_year() ) {
        echo 'Yearly archives : ' . get_the_date('Y');
    } else {
        echo 'Archives:';
    }
?>
</h4>

我该怎么做?与$sHeader = ' < div class = "panel list_header" > < form class = "filter_form" action = "" > < fieldset > < ul > ' . $sFilters . ' < /ul> < /fieldset> < div class = "filter_form_submit_button_wrapper" > < input type = "submit" name = "submit" value = "Suchen" > < /div> < /form> < /div> '; return $sHeader; } 或如何?

2 个答案:

答案 0 :(得分:1)

试试这个

$sHeader = '
            <div class="panel list_header">
                <form class="filter_form" method="get" action=" http://localhost/search_form/">
                    <fieldset>
                        <ul>' . $sFilters . '</ul>
                    </fieldset>
                    <div class="filter_form_submit_button_wrapper">
                        <input type="submit" name="submit" value="Suchen">
                    </div>
                </form>
            </div>
        ';

        return $sHeader;}

答案 1 :(得分:0)

<input type="submit" name="submit" value="Suchen" 
onClick="window.open('http://www.google.com','_self')" />

使用JS,您可以将onClick附加到输入!