[PHP] Google Search For Your Site 05-29-2013, 02:16 AM
#1
This is a piece of source code of which i have used many times on a variety of my websites, it is the best and most accurate source code
you could possibly use if you're thinking of implementing a searching section into your website.
The above code is a very easy and very basic google search of which you may add to your site.
You DO have to change two(2) things
1). Change the value of the site search to your url (where i put `YOUR WEBSITE URL GOES HERE`)
2). also in my google search codes i like to give the searchers a option of searching only your website
or going out of the site to find information about the search on different sites.
So where i put `only search My Url` You should really change the My Url To your real website address
Also the code above will open the google search on the searchers current window
therfore if you would like the searchers to open a new tab upon the search then
replace the top line with this code
Thanks
Mediocrity
you could possibly use if you're thinking of implementing a searching section into your website.
Code:
<form method="get" action="http://www.google.com/search">
<div style="border:1px solid black;padding:4px;width:20em;">
<table border="0" cellpadding="0">
<tr><td>
<input type="text" name="q" size="25"
maxlength="255" value="" />
<input type="submit" value="Google Search" /></td></tr>
<tr><td align="center" style="font-size:75%">
<input type="checkbox" name="sitesearch"
value="YOUR WEBSITE URL GOES HERE" checked /> only search My Url<br />
<br/>This Google Script Was Coded By Mediocrity At http://www.sinister.ly/
</td></tr></table>
</div>
</form>The above code is a very easy and very basic google search of which you may add to your site.
You DO have to change two(2) things
1). Change the value of the site search to your url (where i put `YOUR WEBSITE URL GOES HERE`)
2). also in my google search codes i like to give the searchers a option of searching only your website
or going out of the site to find information about the search on different sites.
So where i put `only search My Url` You should really change the My Url To your real website address
Also the code above will open the google search on the searchers current window
therfore if you would like the searchers to open a new tab upon the search then
replace the top line with this code
Code:
<form method="get" action="http://www.google.com/search" target="_blank">Thanks

Mediocrity
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)


![[Image: BAvhP6h.png]](http://i.imgur.com/BAvhP6h.png)