Welcome to Knowledge Website
Learn basic asp
Web pages designed with html coding are usually called static web pages as they have no dynamic data interactions. Yes, you could have user inputs via a form (including some check boxes, radio buttons, selections interactions) and display them back. But no actually data interaction utilizing a real database. In other words, you can statically use a html form inputs to display right back to user, but cannot store all the data for later use or display. Here comes Active Server Pages (ASP) coding. ASP allows us to interact with a database, such as, Microsoft Access or MySql etc. One catch though, a web page containing asp coding cannot run just by opening in a browser. A server has to support asp coding. An asp page has extension of .asp instead of .html or .htm used in a regular html page.
Example of an asp coding:
<%@ language="vbscript" %>
<%
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open "DSN=apa;UID=sa;PWD="
Set DataCmd = Server.CreateObject("ADODB.Command")
DataCmd.CommandText = "select * from FPLMembers where FPLUserId = '" & request.form("id") & "' and FPLPassword = '" & request.form("pass") & "'"
Set DataCmd.ActiveConnection = DataConn
Set rs_login = Server.CreateObject("ADODB.Recordset")
Set rs_login = DataCmd.execute
if DataConn.Errors.Count > 0 then
for each error in DataConn.Errors
Response.write(Error.Number & ":" & Error.Description)
Next
End if
%>
<%
if rs_login.EOF then
%>
<html>
<head>
<title>Login validation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000" link="#FFFFFF" vlink="#FFFFFF">
<div align="left">
<p> </p>
</div>
<div align=center>
<font color="#FFFFFF"><strong>Your are not an authorize member to login. <br>
If this is not true, please contact your web administrator.<br>
Thanks! Go <a href="index.htm">Back</a>.
</strong></font><br>
</div>
</body>
</html>
<%
else
Session("loggedUser") = rs_login("FPLMemberId")
Session.Timeout = 10
Response.Redirect "updateinfo.asp"
end if
%>
To learn more about asp click here.
