The Nineth day of the 10 Day Society ASP

Source: Internet
Author: User

Purpose of Learning: basic sessionComponent, summary response,requestComponent.
First of all, any program that has a membership system will use to detect whether the user has logged in this step. This is the session.Component, let's look at a code to illustrate.
<%
Session ("IsLogin") = "yes"
%>
The meaning of this sentence is to define a islogin string variable in the session, with a value of "yes", which can be assigned directly, without the need for a declaration. Is it simple?
If we do the admin login system, first is a section of detection is not the administrator
If is then
Session ("ISAdmin") =yes "
Else
Session ("ISAdmin") = "No"
End If
At the front of each page that requires an administrator to see the top plus
<%
If not session ("isaadmin") = "yes" then
Response.Redirect "Login.htm"
%>
This will not be possible for the average user to open this page. Explain the Response.Redirect, it is the meaning of turn, the back of the "login.htm" is the file to turn. This will not be able to see the subsequent content of the administrator.
Here 's a summary of responseComponentThe basic is to use Response.Write (), Response.Redirect () is the function of writing strings and steering request basically is request.form (), Request.QueryString () is to accept the Post,get method of information came to the point here today, and finally my demonstration is a landing system you can study, basically is the above knowledge points relatively simple.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.