Results 1 to 3 of 3

Thread: opine@rocketmail.com

  1. #1
    Join Date
    Dec 1969

    Default opine@rocketmail.com

    I want to use my database to manage hyperlinks on a page, including the destination and # of clicks. For example:<BR><BR>http://www.mysite.com/newprod.asp?LinkID=375<BR><BR>LinkID 375 could be redireted to http://www.someproduct.com or CNN, etc. But the URL is not visible to the user, only the LinkID.<BR><BR>What code would I need to have on the newprod.asp page? Also, is the global.asa good place to place some code relative to LinkID tracking?<BR><BR>Thanks.

  2. #2

    Default RE: opine@rocketmail.com

    &#060;a href="http://www.mysite.com/newprod.asp?LinkID=375"&#062;NewProduct&#060;/a&#062;<BR><BR>***link Page***<BR>&#060;%<BR>&#039get link number<BR>intLinkID = Request.QueryString("linkID")<BR>If intLinkID = "" Then<BR>&#039throw an error<BR>Response.redirect("errorpage.asp")<BR>Els e<BR>&#039Do database connection, get url, tracking<BR>set objDataConn=server.createobject("adodb.connection" )<BR>objDataConn.open "DSN=mydsn; uid=you; pwd=test"<BR>sqltemp = "SELECT * FROM links_table WHERE LinkID=" & intLinkID <BR>set rstemp=Server.CreateObject("ADODB.Recordset")<BR>r stemp.open sqltemp,objDataConn,adOpenKeyset,adLockPessimistic <BR> If rstemp.BOF and rstemp.EOF then<BR> &#039no record found for that linkID<BR> Response.redirect("errorpage.asp")<BR> Else<BR> &#039add one to # of clicks<BR> RStemp("clicks")=cInt(RStemp("clicks")+1<BR> &#039get url<BR> strURL=RStemp("URL")<BR> &#039update<BR> RStemp.Update<BR> &#039close junk<BR> RStemp.Close<BR> Set RStemp = Nothing<BR> objDataConn.Close<BR> Set objDataConn = Nothing<BR> &#039sent them on there way<BR> Response.Redirect(strURL)<BR> End If<BR>End If<BR><BR>I hope this helps. This is just an idea, I have not tried it out.<BR><BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Pulling links from db

    Worked perfectly. Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts