Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 16th, 2006, 08:40 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Banner ad values not working properly.

Hi there, I have created a banner ad using the following code. When viewing the hits counter it works just perfectly. When I go back to check a day or even hours later the hit counters are set at 0 again. Seems to start again and then the hits dissapear later. Any suggestions what to look for?

<%
strURL = Request.Querystring("url")
Select Case lcase(strURL)

Case "http://www.wrox.com"
Application.Lock
Application("iWroxPress") = Application("iWroxPress") + 1
Application.Unlock

Case "http://www.wroxconferences.com"
Application.Lock
Application("iWroxConf") = Application("iWroxConf") + 1
Application.Unlock

End Select
Response.Redirect strURL
%>

<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="Administrator"
MM_authFailedURL="login.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<HTML>
<HEAD>
<TITLE>Ad_Rotator_Hit_Viewer</TITLE>
<link href="css%20files/paragraph.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<table border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#ECECD7">
  <tr>
    <td colspan="4"><div align="center">
      <p><strong>Click-through's for Ad Rotator</strong></p>
    </div></td>
  </tr>
  <tr>
    <td><p align="center"><strong>Business Name</strong></p></td>
    <td><p align="center"><strong>Ad Rotator Name</strong></p></td>
    <td><p align="center"><strong>Number of Click-thoughts</strong></p></td>
    <td><p align="center"><strong>Commencement Date</strong></p></td>
  </tr>
  <tr>
    <td><p>Wrox International</p></td>
    <td><p>WroxPress</p></td>
    <td><p><%= Application("iWroxPress")%></p></td>
    <td><p>29th December 2005</p></td>
  </tr>
  <tr>
    <td><p>Wrox International</p></td>
    <td><p>WroxConferences</p></td>
    <td><p><%= Application("iWroxConf")%></p></td>
    <td><p>29th December 2005</p></td>
  </tr>

Reply With Quote
  #2 (permalink)  
Old January 16th, 2006, 03:13 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Since you're using Application state for the counter, an application restart is probably the cause.

Possible reasons for a restart include:

1. Changed global.asa file.

2. global.asa accessed by anti-virus software.

3. Not 100% sure about this, but I think that also a restarting application pool in IIS might cause a restart. Not sure though...

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old January 17th, 2006, 02:10 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I have disabled the antivirus for a few days to see what happens. Also what did you mean by changed global.asa file. I have included the code below if it helps. I never go into the global.asa fild to alter or add anything. How would I check or stop application pools stopping and restarting? Just so that I can check that it migh be the cause.

<script language="vbscript" runat="server">
    Sub Session_OnStart
      Session("StartTime") = Now()
        Application.Lock
    Application("TotalNumberOfUsers") = _
        Application("TotalNumberOfUsers") + 1
    Application("CurrentNumberOfUsers") = _
        Application("CurrentNumberOfUsers") + 1
    Application.Unlock
    End Sub

    Sub Session_OnEnd
        Application.Lock
    Application("CurrentNumberOfUsers") = _
        Application("CurrentNumberOfUsers") - 1
    Application.Unlock
    End Sub

    Sub Application_OnStart
        Application("EMailAddress") = "malhyp@optusnet.com.au"
    End Sub

    Sub Application_OnEnd

    End Sub
</script>

Again

Thanks


Reply With Quote
  #4 (permalink)  
Old January 17th, 2006, 03:42 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

With changed global.asa I mean whenever the document is saved.

When you make a change to the global.asa file and save it (with Dreamweaver, Notepad, whatever) the file is saved on disk, the application restarts and your app and session variables are gone.
Obviously, also reboots cause the application to restart.

What version of Windows are you using? XP doesn't allow you to create custom Application Pools, so the only thing you can do is change the Isolation level of your website in IIS on the Home tab.

On Server 2003, you can change the Isolation level on the Home tab of your web site to a custom Application Pool that you can create and configure through IIS as well.

For more information and more ideas, check out this thread: http://p2p.wrox.com/topic.asp?TOPIC_ID=12081

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form's calculated field not working properly PaulJH Access 11 March 5th, 2007 09:52 AM
ch 8 code is not working properly Dev_gh78 C# 1 August 4th, 2006 12:16 AM
Scheduled VBS file is not working properly bsrini SQL Server 2000 16 April 14th, 2004 04:09 AM
PreparedStatement not working properly wslyhbb Java Databases 3 September 9th, 2003 01:08 PM



All times are GMT -4. The time now is 10:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.