0

I have custom search form on category category.php list template with following code:

<?php $searchresults = site_url('/?p=1365'); ?>

<form class="search-slide" id="search-slide" name="search-slide" action="<?php echo $searchresults; ?>" method="post">
    <input type="text" name="s_name" id="s_name" size="30" value="" class="find s-name" placeholder="Name Lastname" tabindex="1" />
    <input type="text" name="s_offer" id="" size="30" value="" class="find s-tag"  placeholder="in research offer" tabindex="2" />
    <input type="text" name="s_area" id="" size="30" value="" class="find s-obsz"  placeholder="in Application area" tabindex="3" />
    <input name="s_tags" id="tag-list" value="" tabindex="4" />

    <input class="slideradio" type="checkbox" id="w01" name="w[]" value="w01" />
        <label for="w01"><span></span>Faculty of Architecture</label>
    <input class="slideradio" type="checkbox" id="w02" name="w[]" value="w02" />
        <label for="w02"><span></span>Faculty of Civil Engineering</label>
    <input class="slideradio" type="checkbox" id="w03" name="w[]" value="w03" />
        <label for="w03"><span></span>Faculty of Chemistry</label>

    <input class="slideradio" type="radio" id="adefault" name="s_sort" value="" checked="checked"  tabindex="6"/>
    <label for="adefault"><span></span>Default</label>
    <input class="slideradio" type="radio" id="aasc" name="s_sort" value="" tabindex="7" />
    <label for="adefault"><span></span>Sort A-Z</label>
    <input class="slideradio" type="radio" id="adsc" name="s_sort" value="" tabindex="8" />
    <label for="adefault"><span></span>Sort Z-A</label>

    <button id="slide_search_btn" type="submit">Search</button>
</form>

And I'd like to send variables into another wordpress website search-result.php (template page is added and published in dashboard). But when I click Search button I get error 404 (I have red about naming name fields but I think mine are Ok). But when I enter page directly in browser I got page normally. Can anybody direct me how to resolv this problem?

4
  • 1
    w is a reserved name. Try renaming it.
    – fuxia
    Aug 2 '13 at 11:47
  • Thanks for answer, just checked (renamed to: searchfaculty[]) it, nothing changed.
    – Marcos
    Aug 2 '13 at 11:51
  • @Marcos: Not in your question here. Also there are more reserved names, as you didn't check for that one, it's sometimes likely you've done the same error elsewhere as well (that's just a trick in trouble-shooting I'm trying to tell here, I don't know if that is your issue nor want I say that you didn't do that).
    – hakre
    Aug 2 '13 at 12:15
  • Please answer your question in the answer field, not in the question.
    – fuxia
    Aug 2 '13 at 12:41
0

I found solution: IF you're using permalinks you have to use get_permalink() function:

 <?php $searchresults = site_url('/?p=1365'); ?>

change to

<?php $searchresults = get_permalink( 1365 ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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