• Resolved Rafael Zamith

    (@rgzamith)


    After a long searching, I’ve found this code to make a search box by category, that I’m going to put at the side bar as a text:

    <form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>” />
    <div>
    <input type=”text” name=”s” id=”s” value=”” />
    <input type=”hidden” name=”cat” value=”3″ />
    <input type=”submit” id=”searchsubmit” value=”Search” />
    </div>
    </form>

    But after the first search, an error appeared at the screen and then I saw that the http://www.mysite.com:80/<s=searchingword&cat=3 but this :80 not suppose to be there.

    How I’ll fix it?? I’m putting the code at the right place?

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    (@esmi)

    Try using:

    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>" />

    Thread Starter Rafael Zamith

    (@rgzamith)

    Still not working esmi!

    Showing this again: HTTP Error 400.0 – Bad Request
    ASP.NET detected invalid characters in the URL.

    esmi

    (@esmi)

    What is your site url? The problem may lie there.

    Thread Starter Rafael Zamith

    (@rgzamith)

    I discover my self, don’t know how this thing was missing:

    <div id=”searchbox”>
    <form method=”get” id=”searchform” action=”http://www.mysite.com/”&gt;
    <div>

    I’m not telling the site because it’s blocked, so it doesn’t make any difference.

    But thank, now I’m going to write my other doubt, help there!!

    esmi

    (@esmi)

    You shouldn’t hardcode your site’s url into the search script. Use <?php bloginfo('url'); ?> instead and then correct any issues in your site url.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Search box error’ is closed to new replies.