Well, since you asked I took a little time and made this...
Just put this part in your header of your search page:
<script type="text/javascript">
function googleload()
{
document.f.submit()
}
</script>
- <script type="text/javascript">
- function googleload()
- {
- document.f.submit()
- }
- </script>
Then you will need a if statement to tell if the form has yet been submitted so, put something like this:
<? if(isset($_GET[q])) {
$url = "yoursite.com";?>
<body bgcolor=white onload="load()">
yea this is sc0rp.ath.cx
<form action="http://www.google.com/search" name=f>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=75> </td>
<td align=center>
<input type=hidden name=hl value=en>
<span id=hf></span>
<input type=hidden name=ie value="UTF-8">
<input type=hidden name=oe value="UTF-8">
<input maxLength=256 size=55 name=q value="<? echo "site:$url $_GET[q]"; ?>">
<br><input type=submit value="Google Search" name=btnG>
</td></tr></table></form>
- <? if(isset($_GET[q])) {
- $url = "yoursite.com";?>
- <body bgcolor=white onload="load()">
- yea this is sc0rp.ath.cx
- <form action="http://www.google.com/search" name=f>
- <table cellspacing=0 cellpadding=0>
- <tr>
- <td width=75> </td>
- <td align=center>
- <input type=hidden name=hl value=en>
- <span id=hf></span>
- <input type=hidden name=ie value="UTF-8">
- <input type=hidden name=oe value="UTF-8">
- <input maxLength=256 size=55 name=q value="<? echo "site:$url $_GET[q]"; ?>">
- <br><input type=submit value="Google Search" name=btnG>
- </td></tr></table></form>
Then you will need the form that would regularly show up, this could be on another also, and then you would really need the if statement above but you would need all other code.
<? } else { ?>
<body bgcolor="white">
<form action="<?=$PHP_SELF?>" name=f>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=75> </td>
<td align=center>
<input type=hidden name=hl value=en>
<span id=hf></span>
<input type=hidden name=ie value="UTF-8">
<input type=hidden name=oe value="UTF-8">
<input maxLength=256 size=55 name=q value="">
<br><input type=submit value="Google Search" name=btnG>
</td></tr></table></form>
<? } ?>
- <? } else { ?>
- <body bgcolor="white">
- <form action="<?=$PHP_SELF?>" name=f>
- <table cellspacing=0 cellpadding=0>
- <tr>
- <td width=75> </td>
- <td align=center>
- <input type=hidden name=hl value=en>
- <span id=hf></span>
- <input type=hidden name=ie value="UTF-8">
- <input type=hidden name=oe value="UTF-8">
- <input maxLength=256 size=55 name=q value="">
- <br><input type=submit value="Google Search" name=btnG>
- </td></tr></table></form>
- <? } ?>
I tested this on my server first and it seemed to work just fine, just change the $url variable to your site. If you have any problems, you can IM me on just about any messanger, or PM me.