Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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
  #11 (permalink)  
Old February 28th, 2007, 12:13 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Umm, i am not sure what you mean. In html if you want to have an Image Submit button you would do something like

<INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form">
which would post your form the same way an INPUT TYPE="submit" would.

I am unfamiliar with using flash buttons but if you have an swf file that is animated or something, you could surround your OBJECT tag with an HREF and have the onClick event trigger form.submit();

hth

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #12 (permalink)  
Old February 28th, 2007, 12:16 PM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

i see, i was looking at flash but there is alot of junk code. i am going to look at a simple html submit

ta

Reply With Quote
  #13 (permalink)  
Old February 28th, 2007, 01:20 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default

as far as im aware (Imar may correct me) the code you are referring to is the object code dreamweaver makes for embedding its included choices of flash buttons. You can only link pages with these buttons, so to use that flash button you would have to link to a page that has your session abandon and redirect in it. Or create your own button in flah instead of using dreamweaver's buitl ins.

Reply With Quote
  #14 (permalink)  
Old March 1st, 2007, 06:00 AM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

ok, still got problems!

i thought that i could create a simple <A href> which goes the home.asp and then at the top of the home.asp i put:

<%
Session.Abandon()
%>

thus when you click on the link and get redirected, the session is stopped....

it didnt work out like that, i can still access my protected page without re-logging in. i thought i would start simple and just have a link and set the above code but it didnt like that.

any ideas why that wouldnt work?

Reply With Quote
  #15 (permalink)  
Old March 1st, 2007, 08:47 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Consider this script:
home.asp:
Session("name")="Doug"
Session.Abandon
Response.Write(Session("name"))

The output here will be Doug even though you have called Session.Abandon the reason is that the session object is NOT deleted until ALL of the scripts in the current page have been executed. So, that means that you can call any session values on the page you call Session.Abandon but, after that, the session variables are then gone.

So given the above script when I navigate to this script:
Page2
<%
Response.Write(Session("name"))
%>

My output will be blank.

My guess is that on home.asp you are recreating a session after you have called session.abandon what I would suggest is that your href link to a page called logout.asp and the script of that page shoudl be:

<%
Session.Abandon()
Response.Redirect("home.asp")
%>


================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #16 (permalink)  
Old March 1st, 2007, 09:19 AM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

i tried the logout.asp method and to no avail. The only thing i have in my global.asa is under session_OnStart where i have Session("authenticated")=0

should i have another line of code for session_OnEnd?



Reply With Quote
  #17 (permalink)  
Old March 1st, 2007, 09:48 AM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

could i set in session_OnEnd either:

session("authenticated") = 0

or

session("authenticated") = session("authenticated") -1 ????

would either work as i have read that when i do Session.Abandon it looks in global.asa and if i have nothing declared in session_onend then it will do nothing and not drop the session

am i down the right line?
Reply With Quote
  #18 (permalink)  
Old March 1st, 2007, 09:53 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

By calling Session.Abandon() you are implicitly calling Session_OnEnd so, when Session.Abandon() is called, all code in the Session_OnEnd method will be fired as well.

Reference:
http://www.asp101.com/resources/active_users.asp
http://msdn2.microsoft.com/en-us/library/ms972338.aspx

I assume that a value of 0 for authenticated means the user is logged in so you may want to place code to set the session value back to 0.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #19 (permalink)  
Old March 1st, 2007, 09:57 AM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

ok, when logged in, session("authenticated") = 1, session_onstart is set to session("authenticated") = 0 when the user starts a session.

i will go with this:

Sub Session_OnEnd
session("authenticated") = 0
End Sub

fingers crossed......

Reply With Quote
  #20 (permalink)  
Old March 1st, 2007, 10:07 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Something you may want to try is, after you have been redirected from logout.asp to home.asp you may want to try writing the value of Session("authenticated") to the screen.

After leaving logout.asp (and provided you have no code in your Session_OnEnd) doing Response.write(Session("authenticated")) should return no value (an empty string)

This can at least tell you what your session values are.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
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
Cannot log in brianrodda ASP.NET 2.0 Basics 1 July 15th, 2008 09:02 AM
How to log to server's event log LenexaKS Access VBA 4 March 11th, 2008 12:49 PM
Can't get Log to write the Log.txt file jnbutler BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 July 31st, 2007 04:04 AM
need log on help mohiddin52 Oracle 4 February 14th, 2005 02:20 PM
AppException Class -Log Error to Event Log bekim BOOK: ASP.NET Website Programming Problem-Design-Solution 7 December 7th, 2004 01:01 PM



All times are GMT -4. The time now is 11:55 PM.


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