Archive

Posts Tagged 'ASP'

ASP - Creating a protected section

Requirements:
  • Server with IIS (Internet Information Service) installed;
  • File creation. Mdb (Access format) to usernames and passwords of authorized users;
Knowledge of ASP recommended:
  • Session variables;
  • The Global.asa file;
  • The # include statement;


How many times have you thought about how to protect access to certain pages of your sites?
Now your wish can come true, by following this simple tutorial, created by myself in a simple and intuitive.

First we create the Global.asa file to be included in the root directory of our site, this file is retrieved from the server each time a user accesses the site through the browser (eg Netscape or Explorer), and executes the code in it content in the functions Application_OnStart () and Session_OnStart ().

But if we close the browser window and then abandon the site will run the code inside the functions Session_OnEnd () and Application_OnStart ().

Not necessarily have to be present all four functions within the file, it depends on the needs of the programmer to use them all, some, or none.

The following is added to the code to enter if we wanted to protect some of our pages:

1. <SCRIPT Language=vbscript runat=server>
2. Sub Session_OnStart ()
3. Session ("flag") = 0
4. Session.Timeout = 40
5. End Sub
6. Sub Session_OnEnd ()
7. Session ("flag") = 0
8. End Sub
9. </ SCRIPT>

Continue reading ...

ASP - How to send an e-mail

Requirements:

  • Server with IIS (Internet Information Service) installed;
  • Presence of CDONTS component (usually installed by default).

I noticed that often those who want to approach the world of ASP programming they need to send text, value, form or file to be retrieved from a dynamic page, but do not know how.

Well, in this tutorial I will explain the procedure and find that it is easy and immediate.

The example below allows you to send an email to the recipient with an attached:

Continue reading ...

Tag: , Categories: ASP Tags: ,