SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 11th, 2000, 09:16 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
global.asa

<i><b>Originally posted by : yosef halevy (ry2774ae@isdn.net.il)</b></i><br />i have a global.asa file that works with an asp file and a database-access.i need to know why if the database has his sessionsessionid the global.asa don't "see" it<br />here is the global.asa file:<br /><br /><SCRIPT LANGUAGE=VBScript RUNAT=Server><br /><br />'You can add special event handlers in this file that will get run automatically when<br />'special Active Server Pages events occur. To create these handlers, just create a<br />'subroutine with a name from the list below that corresponds to the event you want to<br />'use. For example, to create an event handler for Session_OnStart, you would put the<br />'following code into this file (without the comments):<br /><br />'Sub Session_OnStart<br />'**Put your code here **<br />'End Sub<br /><br />'EventName Description<br />'Session_OnStart Runs the first time a user runs any page in your application<br />'Session_OnEnd Runs when a user's session times out or quits your application<br />'Application_OnStart Runs once when the first page of your application is run for the first time by any user<br />'Application_OnEnd Runs once when the web server shuts down<br /><br /><br />Sub Application_OnStart<br />Application("visitor") = 0<br />Application("new_visitor") = 0<br />End Sub<br /><br /><br />Sub Session_OnStart<br />'-------------------------------------------------counter for active users and users at all<br />Application("visitors") = Application("visitors") + 1<br />Application("new_visitor") = Application("new_visitor") + 1<br />'---------------------------------------------------using the id information of a new user or an old one<br />Session("visitor_id")=Request.Cookies ("visitor_id")<br />if Session("visitor_id")="" then '-------------------------------("") it means no visitor_id <br /><br />'----------------------------------------------N E W V I S I T O R S<br />dim conn,sql<br />set conn=server.CreateObject ("adodb.connection")<br />conn.Open "101"<br />sql="insert into visitors(visitor_id) values(" & Session.SessionID &")"<br />conn.Execute sql<br />session("visitor_id")=session.SessionID <br />Response.Cookies ("visitor_id")=session.SessionID <br />Response.Cookies ("visitor_id").Expires=now() + 365<br /><br />conn.Close <br />set conn=nothing<br />else<br /><br />'-----------------------------------------------" O L D " V I S I T O R S<br />dim rs<br />set conn=server.CreateObject ("adodb.connection")<br />conn.Open "101"<br />sql="select* from visitors where visitor_id="& session("visitor_id")<br />rs.Open sql,conn<br />session("visitor_id") = rs("visitor_id")<br />session("entry_time") = rs("entry_time")<br />'session("exit_time") = rs("exit_time")<br />'session("visitor_name") = rs("visitor_name")<br />'session("phone")=rs("phone")<br />'session("e_mail")=rs("e_mail")<br />'session("address")=rs("address")<br /><br />rs.close<br />set rs=nothing<br />'end if<br /><br />conn.Close <br />set conn=nothing<br />end if<br />End Sub<br /><br />Sub Session_OnEnd <br />Application("new_visitor") = Application("new_visitor") - 1<br />End Sub<br /><br /><br />Sub Application_OnEnd<br />End Sub<br /><br /><br /></SCRIPT><br /><br /><br />thanks<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > global.asa


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT