Welcome to Geeklog, Anonymous Wednesday, December 11 2024 @ 11:13 am EST

Geeklog Forums

Can a Google search result page open within a static page?

Page navigation


Status: offline

k74

Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
curious
:helpme: Is it possible to have a google search results box open within a staticpage?

The following code is what was given-

<!-- Google Search Result Snippet Begins -->
<div id="googleSearchUnitIframe"></div>

<script type="text/javascript">
var googleSearchIframeName = 'googleSearchUnitIframe';
var googleSearchFrameWidth = 700;
var googleSearchFrameborder = 0 ;
var googleSearchDomain = 'www.google.com.au';
</script>
<script type="text/javascript"
src="http://www.google.com/afsonline/show_afs_search.js">
</script>
<!-- Google Search Result Snippet Ends -->

I just could not get this to work. I have had other feeds open in static pages but this one won't, any suggestions?

Thanks in advance :shakehands:
Live everyday as if it was your last!
 Quote

ironmax

Anonymous
Actually...I think this might work better for you...

Text Formatted Code

<CENTER><!-- Search Google -->
<CENTER>
<FORM action=http://www.google.com/search method=get>
<div align="center">
  <center>
<TABLE bgColor=#ffffff>
<TBODY>
<TR>
<TD>
  <p align="center"><A href="http://www.google.com/"><IMG align=absMiddle border=0
src="http://www.google.com/logos/Logo_40wht.gif" <ALT="Google" width="128" height="53"></A>
<INPUT maxLength=255 name=q size=31>&nbsp; <INPUT name=btnG type=submit value="Google Search">
  </p>
</TD></TR></TBODY></TABLE></center>
</div>
</FORM></CENTER><!-- Search Google -->
 

 Quote

Status: offline

k74

Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
Thanks Ironmax

I tried what you suggested but found it doing the same thing, it either opens a blank page when php is turnes on in the static page or returns the code in the static page with php turned off. For the moment I am happy to have it open up in a new window, but would gratiously accept any suggestions that may get this google script to work within a static page. I found that this is relatively new for google adsense for search subscribers and the script they give out will not work with all site (eg blogger).

Have a nice day :shakehands:
Live everyday as if it was your last!
 Quote

ironmax

Anonymous
Okay...just so you know its working one my site...goto http://www.spacequad.com/staticpages/index.php/20060124155128403 and you will see all sorts of search engines in action...some may have been broken over time.

 Quote

Status: offline

k74

Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
Thanks for the promt rely ironmax. I checked out your site and maybe I may not have explained myself clearly. My mistake.

The code above was for the search results box to open up within my wesite without opening over the site of in a new window. This is a function google now gives you with google adsense for search. I have a search box within my header bar and wanted the results to open within the site.

Sorry for not being clearer, and for not having my site online(hoping this weekend or early next week).

Thanks againg

regards

Kev
Live everyday as if it was your last!
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
K74,

The above code is all you need to put in the staticpage, and you need to tell the "search code" to show the result in this staticpage?

You must have the following code at the top of the search code:

Text Formatted Code
<form method="get" action="URL OF YOUR STATIC PAGE" target="_top">
 


Replace URL OF YOUR STATIC PAGE with the actual url of the staticpage for the result.

Sam
 Quote

Status: offline

k74

Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
:shakehands:

Thanks samstone I will check this over again. I thought I had all that in there but I may have missed something. Working late at night doesn't agree with going through code.
Live everyday as if it was your last!
 Quote

Status: offline

SamF

Forum User
Chatty
Registered: 12/04/06
Posts: 43
I'm interested in this too. I have a Google co-op search bar on my site (here), but haven't been able to figure out how to get the results to show up on my site.

I tried adding Google's code to the search page and the search results page, but I think the php required by the page retrieval and the php required by google mess each other up.

This is the site I told Google to put the search results:
http://www.ai-tools.org/staticpages/index.php?page=20061114141536601

This is the site Google actually goes to
http://www.ai-tools.org/staticpages/index.php?cx=013555921050100862112%3A8qjpccdkcia&amp;q=test&amp;sa=Search&amp;cof=FORID%3A9

If anyone can work out a solution, I'd be very interested.

By the way, Ironmax, the Google search bar on your site doesn't work at all for me -- putting in a test search simply returns me to that page. And the Yahoo and other searches open up in Yahoo, not on your site.
 Quote

ironmax

Anonymous
Quote by: SamF



By the way, Ironmax, the Google search bar on your site doesn't work at all for me -- putting in a test search simply returns me to that page. And the Yahoo and other searches open up in Yahoo, not on your site.



Thats because I was doing some script work trying to get it to open in the same window, otherwise it would have opened in another window. Everything is back to where it was before I started messin with the script.

 Quote

Status: offline

SamF

Forum User
Chatty
Registered: 12/04/06
Posts: 43
Quote by: ironmax
Thats because I was doing some script work trying to get it to open in the same window, otherwise it would have opened in another window. Everything is back to where it was before I started messin with the script.

[/p]

Right, it opens up in Google, just like k74 and my search bar. In theory there's a way for the results to open up in your own site, but I haven't figured out a way to do this with Geeklog yet.

Any more thoughts greatly apopreciated!
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
SamF,

You already have the answer to the question as you read the previous posts. In fact, Google Adsense site has clear instruction for doing that.

Sam
 Quote

Status: offline

SamF

Forum User
Chatty
Registered: 12/04/06
Posts: 43
Quote by: samstone
You already have the answer to the question as you read the previous posts. In fact, Google Adsense site has clear instruction for doing that.


Hi Sam,

As I mentioned a few posts up, I did this, and it doesn't appear to work for me site.

First I tried doing it with Google Co-op, using the exact code that they recommended. Then I tried modifying the form header code slightly to be the way you posted. Then I tried doing a regular Google search bar, as k74 posted, with your header, and still nothing.

In all cases (as I mentioned), instead of trying to go to the static page I requested, e.g. http://www.ai-tools.org/staticpages/index.php?page=20061114141536601, it would try to go to a url like http://www.ai-tools.org/staticpages/index.php?cx=013555921050100862112 ....

Since that page doesn't exit, I would get the message "Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions."

Here's the code I used to try and get Google Co-op to work:
Text Formatted Code

<!-- Google CSE Search Box Begins -->
<form id="searchbox_013555921050100862112:8qjpccdkcia" action="http://www.ai-tools.org/staticpages/index.php?page=20061114141536601">  // adding method="get" and target="_top" to this makes no difference
  <input type="hidden" name="cx" value="013555921050100862112:8qjpccdkcia" />
  <input name="q" type="text" size="40" />
  <input type="submit" name="sa" value="Search" />
  <input type="hidden" name="cof" value="FORID:9" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_013555921050100862112%3A8qjpccdkcia"></script>
<!-- Google CSE Search Box Ends -->
 

With this on the results page
Text Formatted Code

<!-- Google Search Result Snippet Begins -->
<div id="results_013555921050100862112:8qjpccdkcia"></div>
<script type="text/javascript">
  var googleSearchIframeName = "results_013555921050100862112:8qjpccdkcia";
  var googleSearchFormName = "searchbox_013555921050100862112:8qjpccdkcia";
  var googleSearchFrameWidth = 600;
  var googleSearchFrameborder = 0;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
<!-- Google Search Result Snippet Ends -->
 


Since that didn't work, I tried Ironmax's's code, with your header:

Text Formatted Code

<CENTER><!-- Search Google -->
<CENTER>
<form method="get" action="http://www.ai-tools.org/staticpages/index.php?page=20061114141536601" target="_top">
<div align="center">
  <center>
<TABLE bgColor=#ffffff>
<TBODY>
<TR>
<TD>
  <p align="center"><A href="http://www.google.com/"><IMG align=absMiddle border=0
src="http://www.google.com/logos/Logo_40wht.gif" <ALT="Google" width="128" height="53"></A>
<INPUT maxLength=255 name=q size=31>&nbsp; <INPUT name=btnG type=submit value="Google Search">
  </p>
</TD></TR></TBODY></TABLE></center>
</div>
</FORM></CENTER><!-- Search Google -->
 


Again, nothing.

If you have figured out a way to actually get the results to show up on your Geeklog site, I'd love to see how you did it. So far, I haven't seen this happen.

Thank you,
Sam
 Quote

Status: offline

Chrispcritters

Forum User
Chatty
Registered: 05/11/05
Posts: 49
Location:Tustin, CA
I've got it working on this page: (Regular Google Search)

http://www.whatismyipaddress.com/staticpages/index.php/how-do-I-use-a-proxy-server

Which when you use the search within the static page, directs the results to another static page.

The code on the source page is:
Text Formatted Code
<form method="get" action="http://www.whatismyipaddress.com/staticpages/index.php/search-results" target="_top">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

<input type="text" name="q" size="31" maxlength="255" value="proxy server list"></input>
<input type="submit" name="sa" value="Google Search"></input>
<input type="hidden" name="client" value="pub-{removed}"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="{removed}"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399; AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF; T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>


The code on the landing page:
Text Formatted Code
<div id="googleSearchUnitIframe"></div>

<script type="text/javascript">
   var googleSearchIframeName = 'googleSearchUnitIframe';
   var googleSearchFrameWidth = 650;
   var googleSearchFrameHeight = 1300;
   var googleSearchFrameborder = 0 ;
</script>
<script type="text/javascript"
         src="http://www.google.com/afsonline/show_afs_search.js">
</script>
 Quote

Status: offline

SamF

Forum User
Chatty
Registered: 12/04/06
Posts: 43
Quote by: Chrispcritters

I've got it working on this page: (Regular Google Search)



Hmmm... While I see this works on your page, I've copy-and-pasted it onto my page and it doesn't work.

I replaced your static page url, which was
http://www.whatismyipaddress.com/staticpages/index.php/search-results
with mine, which is
http://www.ai-tools.org/staticpages/index.php?page=20061114141536601
When I do a search, the page that tris to open is
http://www.ai-tools.org/staticpages/index.php?q= ...
which doesn't exist, and so gives me an error.

Now, I'm a php newbie, but am I right in thinking that the source of my troubles is the fact that, while you have a nice static page url (staticpages/index.php/search-results), I have a nastier one (staticpages/index.php?page=...)? It seems to me that Google's PHP is replacing the PHP I need for my page. (This is what I asked about six posts further up, but it was ignored).

If this is the source of my problems, should I try to get nice URLs like you? Is that the tidyURL hack, or whatever it's called?

Thanks,
Sam
 Quote

Status: offline

Chrispcritters

Forum User
Chatty
Registered: 05/11/05
Posts: 49
Location:Tustin, CA
Is the URL rewrite used with geeklog.

I'd try to get it working simply first, then added complexity later.
 Quote

ironmax

Anonymous
Quote by: SamF

Quote by: Chrispcritters

I've got it working on this page: (Regular Google Search)



Hmmm... While I see this works on your page, I've copy-and-pasted it onto my page and it doesn't work.

Sam



I think you may have missed something here in the directions. What Chrispcritters was trying to say is that you need to make 2 static pages. One for the initial page, below..

Text Formatted Code

<form method="get" action="http://www.ai-tools.org/staticpages/index.php?page=20061114141536601" target="_top">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

<input type="text" name="q" size="31" maxlength="255" value="proxy server list"></input>
<input type="submit" name="sa" value="Google Search"></input>
<input type="hidden" name="client" value="pub-{removed}"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="{removed}"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399; AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF; T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
 

Then on the second static page that you create, put the following code below...
Text Formatted Code

<div id="googleSearchUnitIframe"></div>

<script type="text/javascript">
   var googleSearchIframeName = 'googleSearchUnitIframe';
   var googleSearchFrameWidth = 650;
   var googleSearchFrameHeight = 1300;
   var googleSearchFrameborder = 0 ;
</script>
<script type="text/javascript"
         src="http://www.google.com/afsonline/show_afs_search.js">
</script>
 


Now of course you will have to change the http://www.whatismyipaddress.com/staticpages/index.php/search-results" in the first box above to reflect your system, which I've done for you. So, in total...you should have 2 static pages for google to work. I hope this helps clarify it for everyone.
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
SamF,

You need to use url rewrite feature. That is to be set in Geeklog's config.php, so that your url won't show a question mark like staticpages/index.php?page=20061114141536601, instead it will show something like staticpages/index.php/20061114141536601.

Hope this helps!

Sam
 Quote

ironmax

Anonymous
Quote by: samstone

SamF,

You need to use url rewrite feature. That is to be set in Geeklog's config.php, so that your url won't show a question mark like staticpages/index.php?page=20061114141536601, instead it will show something like staticpages/index.php/20061114141536601.

Hope this helps!

Sam



Okay...that makes sense...opps...I missed that one
 Quote

Status: offline

k74

Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
I got it finally working with the code from the google site, I must of been placing the header script incorrectly. Now you can type in your search in the header and get results within a google static page. You can get this code once you register with adsense on google. Thanks for your help. :shakehands:
Live everyday as if it was your last!
 Quote

ironmax

Anonymous
If anyone that knows how to program may want to try the same thing with Yahoo. Here's the information needed to build off of their APIs. http://www.fiftyfoureleven.com/weblog/web-development/programming-and-scripts/apis/yahoo-apis-search-web-services
 Quote

Page navigation

All times are EST. The time is now 11:13 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content