Web Analytics Made Easy -
StatCounter Appending users Keywords to a file - CodingForum


No announcement yet.

Appending users Keywords to a file

  • Filter
  • Time
  • Show
Clear All
new posts

  • Appending users Keywords to a file

    Hi folks,
    can one of the experts show me how to:

    1. append the following results to a .txt file.

    2. transform the ampersands to white spaces.I am in germany so there are many letters like: ü, ن, ِ which google writes as ampersand

    3. if keywords = table content, then hilite the table-cell (DIV)where they are situated

    I am not working with PHP.

    <script type="text/javascript">  
    var searchFld = document.getElementById("adiv");  
    if (searchFld != null)  
      var keywords = document.referrer.match(/[pq]=.*?\&/);  
      if (keywords != null && keywords.length > 0)  
        searchFld.value = keywords[0].replace(/[pq]=/,"").replace(/(\+|%20|\&)/g, " ");  

  • #2
    You'll need some sort of server-side script to write to a txt file (I recommend php or asp depending on your host). That part is easy enough but not for this forum.

    You don't need to worry about the special characters once passed to your server-side api, but in Javascript you can simply encode them, AJAX (or form submit) the variables to your api and have it append it to your txt file.
    Feel free to e-mail me if I forget to respond ;)
    [email protected]