TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,971
  • Latest: camgear
Stats
  • Total Posts: 196,067
  • Total Topics: 21,338
  • Online today: 361
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 285
  • Total: 285

Google Custom Search in article page ??

Started by bluedevil, July 17, 2009, 01:37:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mick

Ive been scratching my head on this one for awhile now....

Im trying to take advantage of Google's custom search.

It requires 2 codes....... 1 for the "search box"  and the other for the results.   I need 2 article pages for this.

This is the article page that has the first code.....the "search box".  It contains the URL of my results page.
http://www.chevyavalancheclub.com/index.php?page=320

<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>
<div class="cse-branding-bottom" style="background-color:#FFFFFF;color:#000000">
 <div class="cse-branding-form">
   <form action="http://www.chevyavalancheclub.com/index.php?page=321" id="cse-search-box">
     <div>
       <input type="hidden" name="cx" value="partner-pub-0022808160619558:mukf5e-uuzb" />
       <input type="hidden" name="cof" value="FORID:10" />
       <input type="hidden" name="ie" value="ISO-8859-1" />
       <input type="text" name="q" size="31" />
       <input type="submit" name="sa" value="Search" />
     </div>
   </form>
 </div>
 <div class="cse-branding-logo">
   <img src="http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" />
 </div>
 <div class="cse-branding-text">
   Custom Search
 </div>
</div>





...and this is the code of the "results page"  (2nd article page).
http://www.chevyavalancheclub.com/index.php?page=321

<div id="cse-search-results"></div>
<script type="text/javascript">
 var googleSearchIframeName = "cse-search-results";
 var googleSearchFormName = "cse-search-box";
 var googleSearchFrameWidth = 800;
 var googleSearchDomain = "www.google.com";
 var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>




After set and done,....i tried searching but instead of taking me to the "results page"  (http://www.chevyavalancheclub.com/index.php?page=321),......it takes me to the home page instead.

Hmmmm,.....i dont get it.   Whats wrong with this?


Mick.

IchBin

I don't know the problem with your form, but I do see that you have some messed up code on your site. You have some google ad code in your output that is not even complete. Its missing a <script> tag from what I can see.

Mick

Quote from: IchBinâ„¢ on July 17, 2009, 01:53:54 AM
I don't know the problem with your form, but I do see that you have some messed up code on your site. You have some google ad code in your output that is not even complete. Its missing a <script> tag from what I can see.

Where do you see this?

Footer maybe?

IchBin

When I click on the link you pasted above and I view the source of your page I see the incomplete google code.

Mick

Hmmm..... i just looked at both pages and was able to see the codes as posted above.


Mick

It works fine if i wanted the results to show outside of my website.    But no luck within.

IchBin

I didn't say there was a problem with the codes you posted above. I said there was a problem with your ad code.

Mick

Quote from: IchBinâ„¢ on July 17, 2009, 02:10:50 AM
I didn't say there was a problem with the codes you posted above. I said there was a problem with your ad code.

You think the google's code is incomplete?

IchBin

Nevermind, I didn't see some code that was way out of alignment in the output of your page. It would appear that your <form> tag doesn't have an posting method. It needs to either use method="post" or method="get" to post the results to your page.

Mick

#9
I must be something wrong.

Article #320 has the google search box.   Article #321 suppose to have the results....

Funny,that after a quick search,..... it takes me to the home page instead of Article #321.


Hmmmm.........

This website is proudly hosted on Crocweb Cloud Website Hosting.