0

I'm writing filter for posts by category on author page.

I send category name in $_GET array in this form:

<form action="" accept-charset="UTF-8" method="get" id="form1">
      <select name="type" class="form-select" id="edit-type">
           <option value="all">All</option>
           <option value="articles">Article</option>
           <option value="posts">Blog Post</option>
       </select>
       <input type="submit" value="Apply" class="form-submit">
</form>

For exapmle I have link www.mysite.com/?author=8. If I type link www.mysite.com/?author=8&type=posts, all works correct, but if I use form, I'm redirect to home page just with parameter 'type' www.mysite.com/?type=posts

Also, I try to use in form action current page url, porblem is the same.

How can I send get parameter and redirect to slef page?

1
  • You are using the default permalinks?
    – s_ha_dum
    Feb 11, 2014 at 14:59

1 Answer 1

-1

use action="#" or action="<?php echo($_SERVER["PHP_SELF"]);?>" to redirect to same page

1
  • 2
    Please explain why this answers OPs question.
    – Howdy_McGee
    Jul 14, 2015 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.