Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 18th, 2004, 11:51 AM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Recording clicks on intrapage links

I'm already using VBScript and ASP to record in a text file visits to the home page of my small website. At the top of my home page I have a list of intrapage links to content on the page. Is it also possible for me to record in my text file which intrapage links are clicked on?
Reply With Quote
  #2 (permalink)  
Old May 19th, 2004, 12:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

May be On click of any of those links on home page, you can call a function that writes into textfile about the link that was clicked and then redirect to the corresponding page.

Hope that Helps
Cheers!

-Vijay G
Reply With Quote
  #3 (permalink)  
Old May 21st, 2004, 01:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Tom,

I found a work around for this. It works fine. Here you go.

Details of what it does.
  • Consider "test.asp" as the first page, where you got the links to click and get its info stored on to a text file.
  • "test1.asp" is where the code for writing to text file is given.
  • on click of any of the 4 links on "test.asp" page, takes to "test1.asp" where the article/link info is written/appended to "text.txt" and then redirected to "test.asp" with #name reference

test.asp
--------
Code:
<html>
<HEAD>
</HEAD>

<BODY>

<a href="#Article1">&nbsp;</a>
<a href="test1.asp?qs=Article1">Title_of_Article1</a>
<br><br>
<a href="#Article2">&nbsp;</a>
<a href="test1.asp?qs=Article2">Title_of_Article2</a>
<br><br>
<a href="#Article3">&nbsp;</a>
<a href="test1.asp?qs=Article3">Title_of_Article3</a>
<br><br>
<a href="#Article4">&nbsp;</a>
<a href="test1.asp?qs=Article4">Title_of_Article4</a>

</BODY> 
</html>
test1.asp
---------
Code:
<%

    dim fs, ft, tout, article_title

    article_title=Request.querystring("qs")

    set fs=Server.CreateObject("Scripting.FileSystemObject")
    ft = server.mappath("text.txt")
    set tout = fs.opentextfile(ft, 8, true)
    tout.writeline(article_title)
    tout.close
    set fs = nothing
    set ft = nothing
    set tout = nothing

    Response.Redirect("./test.asp#" & article_title)
%>
Hope that helps.
Cheers!

-Vijay G
Reply With Quote
  #4 (permalink)  
Old May 22nd, 2004, 11:07 AM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by happygv
 Hi Tom,

I found a work around for this. It works fine. Here you go.
Many thanks Vijay for your most clever solution! It works so beautifully that I'm going to use it also in the link at the end of each article returning to the table of contents, so that, together with a record of the time, I can tell not only which article was selected but also how much time was spent reading the article (provided that the visitor used the links instead of scrolling down the page).
Tom
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
httpmodule to count number of clicks a specific li Sheraz Khan ASP.NET 2.0 Professional 0 November 15th, 2008 02:35 PM
Refresh Page when User Clicks on Back Button testsubject Visual Studio 2005 1 June 26th, 2006 03:46 AM
Recording in C# clojinted General .NET 0 March 8th, 2005 10:55 AM
Chapter 14 Responding to clicks tfackler BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 February 1st, 2005 11:40 AM
capturing clicks on sql report tabs ilfirinelda BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 October 10th, 2004 10:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.