Hi All
I want to implement google search box on my site with the condition that whenever i search something , then the results gets displayed on my site , instead of showing it on google.
Kindly help me , i need to implement it on my site as soon as possible.
Thanks ALL
Dsingh
Code for google search result shown on my own site
Moderator: General Moderators
Re: Code for google search result shown on my own site
The easiest way for someone new to do something like this is just to try to copy some tutorial and use a tool someone built (JSON).
http://dev-tips.com/featured/php-tip-ad ... e-with-php
http://dev-tips.com/featured/php-tip-ad ... e-with-php
Re: Code for google search result shown on my own site
Thanks for replying , I have used the code but I'am getting warning like this one , same shown on http://dev-tips.com/featured/php-tip-ad ... e-with-php .
“Warning: Invalid argument supplied for foreach() in /home/irishtit/public_html/09/querygoogle.php on line 29″
Please help
“Warning: Invalid argument supplied for foreach() in /home/irishtit/public_html/09/querygoogle.php on line 29″
Please help
Re: Code for google search result shown on my own site
Did you read the comments about that problem on the page you got the code from and then look at line 9? I think it is a problem with the URL not being passed through urlencode properly.
Put this line at Line 10 and post the results back here.
Put this line at Line 10 and post the results back here.
Code: Select all
echo "URL=".htmlentities($url)."<br />";Re: Code for google search result shown on my own site
Look up Google Custom Search (or something along those lines). Google provides this service.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Code for google search result shown on my own site
@pickle The example I linked uses google's Custom Search Engine (CSE) API for searching via php. The links on google (which seem to be broken) use javascript for their CSE API.
Re: Code for google search result shown on my own site
Thanks Eric and Pickle for replying to query , Finaly i solved the problem , Thanks again