laflair13 — 2013-03-14T10:46:54-04:00 — #1
I am looking to add a search box to my website where if a person puts in what they want, the results will come on another page with the results. I had google search on there and now it is not working. it is just coming up blank.
Can anyone lead me to a tutorial that shows how to do this? The site runs on php/mysql
philiptoop — 2013-03-14T11:11:27-04:00 — #2
Can you provide the url of the site.
laflair13 — 2013-03-14T11:13:52-04:00 — #3
philiptoop — 2013-03-14T11:22:26-04:00 — #4
laflair13 — 2013-03-14T12:05:51-04:00 — #5
Ok, didnt know that. Just dont get why it would work a week ago and all of a sudden it dont now.
you can see the search box down the middle of the page.
philiptoop — 2013-03-14T12:13:48-04:00 — #6
Got getting anything when I use the URL
laflair13 — 2013-03-14T12:17:24-04:00 — #7
philiptoop — 2013-03-14T12:51:07-04:00 — #8
You are adopting an approach I am not familiar with
Have you seen https://developers.google.com/custom-search/docs/element?
I usually think of it in two ways.
The first simple needs something like
var cx = '123:456'; // Insert your own Custom Search engine ID here
gcse.src = (document.location.protocol == 'https' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(gcse, s);
<!-- Place this tag where you want both of the search box and the search results to render -->
on the web page.
That been said I get the impression that results.php is being called correctly. This would suggest that something is wrong server side.
The query to google should be
but this does not return anything. It could be that the custom search is not configured correctly.
I would go into custom search and use the preview.
smanaher — 2013-03-15T10:26:29-04:00 — #9
You can install the Google search or you can apply a third party search script on your site.
Here is a php script that you can download,
It allows you to specify directories that you do not want to search, comes with a customizable template and you can make usability tweaks like displaying the number of search results per page.
Hope that helps,