bd1e0d0 Posted January 9, 2006 Share Posted January 9, 2006 How do I make a search script in PHP? I want simple because it's for a single site only. I was thinking of just having a form linked to Google, but I want that to be a last resort. Link to comment Share on other sites More sharing options...
zanfranceschi Posted January 11, 2006 Share Posted January 11, 2006 if you want a content search (which i believe is what you want) AND your site has database content, it would be very easy.But if your site doesn't have database and you want to perform a search in the content embedded in the files, you'll have to be very creative and it may become a bit complex...If you want the latter and don't know how to start, I suggest you could create a separeted file containing only keywords and references to the sessions of your site. Link to comment Share on other sites More sharing options...
bd1e0d0 Posted January 14, 2006 Author Share Posted January 14, 2006 if you want a content search (which i believe is what you want) AND your site has database content, it would be very easy.But if your site doesn't have database and you want to perform a search in the content embedded in the files, you'll have to be very creative and it may become a bit complex...If you want the latter and don't know how to start, I suggest you could create a separeted file containing only keywords and references to the sessions of your site.<{POST_SNAPBACK}> I don't do sessions, I view them the same as cookies. They're stupid and I hate them. [i actually don't know hoe to do them, heh heh ... ] Link to comment Share on other sites More sharing options...
Eric Posted January 14, 2006 Share Posted January 14, 2006 In the meantime, you could get a basic Google Search box.Check this page out http://www.google.com/searchcode.html Link to comment Share on other sites More sharing options...
bd1e0d0 Posted January 15, 2006 Author Share Posted January 15, 2006 In the meantime, you could get a basic Google Search box.Check this page out http://www.google.com/searchcode.html<{POST_SNAPBACK}> I kinda sorta knew how to make the Google search anyway. Although it's more simple to do this:<html> <head> <script language="JavaScript" type="text/javascript"> function gsearchme() { window.location="http://www.google.com/search?q=" + document.forms.google.q.value + " site:http://my.web.page/"; } </script> </head> <body> <form name="google" action="javascript:gsearchme();" method="get"> <label for="q">Google</label> <input type="text" name="q" /> <input type="submit" value="Google Search" /> </form> <body></html> It works, trust me. All browsers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now