SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2012
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What am I doing wrong with my search box?

    Hi guys, I've been trying to design a simple search box on my site but it doesn't seem to be working... (Please forgive me, I'm a noob at PHP )

    Here is what I'm using:
    Code:
    <div class="search_div">
    		<ul class="nav_ul">
    				<li class="yelow_btn">
    								<img src="http://www.mysite.com/wp-content/themes/images/yelow_left_btn.jpg">
    <span>
    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
        <div>
            <input type="text" value="" name="s" id="s" />
            <input type="submit" value="" onclick="" class="search_btn">
        </div>
    </form>
    </span>
    <img src="http://www.mysite.com/wp-content/themes/images/yelow_right_btn.jpg">
    				</li>
    		</ul>
    </div>
    Right now when I try using it it just takes me to http://www.mysite.com/%3C?s=searchterm - any advice? Thanks in advance!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Is this a Google search form? Your form's only action is to call the home page, but unless that has some kind of script on it, nothing much can happen. Or is this part of a CMS?

    I recommend you use a standard Google search form, which is super easy to set up.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Member
    Join Date
    Mar 2012
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Is this a Google search form? Your form's only action is to call the home page, but unless that has some kind of script on it, nothing much can happen. Or is this part of a CMS?

    I recommend you use a standard Google search form, which is super easy to set up.
    Yep, I'm using wordpress - the correct page for that the search button should bring the user to would be http://www.mysite.com/?s=searchterm.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    OK, I've moved this to the WP forum, as it's really a question of how to use that CMS.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •