Hi,

I'm in the process of setting up a new website. The site has a search form. Visitors can enter any search keywords to search our database for information. There are Google Adsense ads in the Search Result Page. We also log or record the search terms visitors enter.

There is one problem installing the Google AdSense Code in the Search Result Page. It is that the Google AdSense Code will cause our script to log the seach term one more time after our script has logged the entry already.

The followings will illustrate what the problem is. Let's say a visitor enter 'San Jose' in our search form to find information about 'San Jose' in our database. Our script will record or log 'San Jose' in our log table, prints the Search Result page with Google AdSense Ad in it, but the Google AdSense Code will cause our script to record 'San Jose' again in the table, causing 2 entries of 'San Jose' in our log table.

I'm curious if any of you has experienced similar problems? If you've, how do you solve the problem?

Background information of the site:

Server: Linus
Programming language: Perl
Database: MySql

In reply to Google AdSense Code causes double entries of search terms in the log table by aceofspace

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.