Bueno, ya que pidió que tomé un poco de tiempo y de hecho este...
Sólo hay que poner esta parte en el encabezado de su página de búsqueda:
<script type="text/javascript">
function googleload()
{
document.f.submit()
}
</script>
- <script type="text/javascript">
- function googleload()
- {
- document.f.submit()
- }
- </script>
Entonces, usted necesitará una sentencia if para saber si el formulario no se ha presentado así, poner algo como esto:
<? 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>
Entonces se necesitará la forma en que regularmente se presenta, esto podría estar en otro también, y entonces sí sería necesario si la declaración anterior, pero se necesitaría todo el código de otros.
<? } 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>
- <? } ?>
He probado esto en mi primer servidor y parece que ha funcionado muy bien, simplemente cambia la variable $ url en su sitio. Si usted tiene algún problema, puede IM mí en casi cualquier mensajero, o PM me.