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
Can you provide the url of the site.
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.
Got getting anything when I use the URL
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.
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,
This topic is now closed. New replies are no longer allowed.