WordPress.org

Support

Support » How-To and Troubleshooting » search form adding extra

search form adding extra

  • Hi

    I have a widget for a custom search form on my website as the following (which definitely worked in 2010)

    <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
    <p>Search for: <input type="text" class="search_input" value="searchstring"
    name="s" id="s" /></p>
    <input type="submit" id="searchsubmit" value="Search" />
    </form>

    The problem is that the URL I get is
    http://www.mydomain.com/&lt;?s=searchstring

    which does not work because of the ‘<‘

    http://www.mydomain.com/?s=searchstring

    works fine but I cannot figure out why the ‘<‘ is being added.

Viewing 1 replies (of 1 total)
  • esmi

    @esmi

    Forum Moderator

    :

    <form method="get" id="searchform" action="<?php echo home_url(); ?>">
    <div>
    <label for="s" class="offset"><?php _e('Keyword(s)');?></label> <input class="text" type="text" value=" " name="s" id="s" />
    <input type="submit" class="submit button" name="submit" value="<?php _e('Search');?>" />
    </div>
    </form>

Viewing 1 replies (of 1 total)
  • The topic ‘search form adding extra’ is closed to new replies.
Skip to toolbar