October 24, 200818 yr How do you get a search box to work is it done through SQL ? If so please advise how and why.... Cheers
October 24, 200818 yr Author Come on guys I really need to know how to do this. the box looks like: So how do I get it so that once something is inputted to search for how do i do it and whats been used.
October 24, 200818 yr How do you get a search box to work is it done through SQL ? If so please advise how and why.... Cheers Hi you can use mysql for a search <form method="GET" action="keywordsearch.php"> Search the classifieds for keywords:<br /> <input type="text" id="search" name="search" /><br /> <input type="submit" value="Search!" /> </form> keywordseach.php $search=$_GET['search']; $data = mysql_query("SELECT * FROM table_name WHERE MATCH(column1,column2) AGAINST('$search*' IN BOOLEAN MODE) order by id desc") or die(mysql_error()); ///////////////////////////////////////////////////////////////////////////////////////////////// or if your site in indexed by google use google to do it for you <script type="text/javascript"> // Google Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/ // This notice must stay intact for use //Enter domain of site to search. var domainroot="www.javascriptkit.com" function Gsitesearch(curobj){ curobj.q.value="site:"+domainroot+" "+curobj.qfront.value } </script> <form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)"> <p>Search JavaScript Kit:<br /> <input name="q" type="hidden" /> <input name="qfront" type="text" style="width: 180px" /> <input type="submit" value="Search" /></p> </form> <p style="font: normal 11px Arial">This free script provided by<br /> <a href="http://www.javascriptkit.com">JavaScript Kit</a></p>
Create an account or sign in to comment