WordPress.org

Forums

Search works from Main page...HELP!!! (6 posts)

  1. actionbasic
    Member
    Posted 8 years ago #

    http://www.detour-mag.com/content/

    the search only works if you search from the homepage. Can someone help me out with this? I know its just a small change in the search code, but I am stuck. Here is my code...

    <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text" name="s" id="s" value="search this site..."/>
    <label>
    <input type="submit" name="Submit" value="Go!" />
    </label>
    </form>

    and thoughts??

  2. actionbasic
    Member
    Posted 8 years ago #

    Sorry. the search works ONLY from the main page.

  3. whooami
    Member
    Posted 8 years ago #

    thats insecure. DONT use $_SERVER['PHP_SELF'] whatever you do. And yes, I know thats inside a lot of themes, now is your chance to change it.

  4. actionbasic
    Member
    Posted 8 years ago #

    What do I change it to?

  5. whooami
    Member
    Posted 8 years ago #

    when you get that far and have solved whatever problem this thread is actually about:

    Use:

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

    OR

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

  6. actionbasic
    Member
    Posted 8 years ago #

    works now! thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags