Welcome to Geeklog, Anonymous Sunday, October 06 2024 @ 04:20 pm EDT
Geeklog Forums
Can a Google search result page open within a static page?
Page navigation
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!
ironmax
<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> <INPUT name=btnG type=submit value="Google Search">
</p>
</TD></TR></TBODY></TABLE></center>
</div>
</FORM></CENTER><!-- Search Google -->
k74
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!
ironmax
k74
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!
samstone
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:
Replace URL OF YOUR STATIC PAGE with the actual url of the staticpage for the result.
Sam
k74
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!
SamF
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&q=test&sa=Search&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.
ironmax
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.
SamF
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!
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.
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:
<!-- 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
<!-- 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:
<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> <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
Chrispcritters
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:
<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:
<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>
SamF
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
Chrispcritters
I'd try to get it working simply first, then added complexity later.
ironmax
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..
<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...
<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.
samstone
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
ironmax
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
k74
Live everyday as if it was your last!
ironmax
Page navigation
- 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