View Full Version : [Help] Regarding a search code

10-15-2012, 09:59 AM

Im having a bit of a problem with my new project ( site ) i'm working with a template and I like the search bar and I want to keep it but it doesen't work or I don't know how to make it work, because nothing happens when I hit search.

My opinion :

1. Maybe I can make all the search box a link so when I click it to redirect me to google, but to keep the design on my website. ( how do I do that ? )

2.Maybe you guys can make it work to actually search something ...

Search box code :

<!-- searchform *copy/paste this code to place anywhere in the page-->
<form method="get" id="searchform" action="#">
<label class="screen-reader-text" for="s">Search for:</label>
<input value="Type Your Search Here" name="s" id="s" type="text" />
<input id="searchsubmit" value="search" src="images/searchbutton.png" type="image" />
<!-- end of searchform -->

Thanks in advance !

Image for search bar ( that I want to keep and make it functionally )

http://imageshack.us/a/img222/3348/probll.png (http://imageshack.us/photo/my-images/222/probll.png/)

Uploaded with ImageShack.us (http://imageshack.us)

10-15-2012, 10:54 AM
No wonder it’s not doing anything because you have to tell the form what to do on submit, it can’t read your (and our) mind(s).

Do you see this:

<form method="get" id="searchform" action="#">

The action attribute must contain a path to a script that is processing the form input. This script should be a server side script like PHP, ASP.NET, Perl, ColdFusion, or whatever, and should have the function(s) to read out the values of the form controls.

Since PHP is the most popular programming language for websites and is most widely supported I’m going to move this thread to the PHP section, maybe these guys can help you out.

10-15-2012, 04:03 PM
So, can you give me an example of how it should look like ?

10-16-2012, 01:28 PM
If I was you I would start off by learning some basic PHP just to get the hang of it by using w3schools (http://www.w3schools.com/php/default.asp)

Good Luck!