Interaction
You can create a Web page like senduserinfo.htm (sending user information), where the form is implemented to send the user's name, sex, and message to ourselves, but if we only use HTML we can only give the form a <form method= "POST" Action=mailto:web@webjx.com>, we can use ASP program to realize the processing of form data in ASP. Here we just need to change <form method= "POST" action=mailto:xxx@webjx.com> to <form method= "POST" action= "userinfo.asp" > You can send the data you submitted to the userinfo.asp processing.
Of course, we should first create a database table before implementation, the table contains Username,usergender,userinfo three fields, in this do not explain the establishment of the database table, focusing on the Userinfo.asp program code.
Userinfo.asp's source code request.form ("UserName"), Request.Form ("Usergender"), Request.Form ("UserInfo"), Usergender and UserInfo are the name representations of the data to be submitted in senduserinfo.htm. You can compare senduserinfo.htm with userinfo.asp. The following is a partial explanation of Userinfo.asp's source code
<% ASP uses the VBScript language, and you can also change to a JavaScript language. %>
<%@ Language=vbscript%>
<% ' userinfo.asp
Option Explicit
Response.expires=0
Dim StrName, Strgender, STRM, STRMSG
' Get senderuserinfo.htm's name: Name= ' UserName ' transmitted data.
StrName = Trim (Request.Form ("UserName")) ' trim function is used in addition to trailing spaces
' Get Sex in senderuserinfo.htm:: Name= ' usergender ' data sent over
Strgender = Trim (Request.Form ("Usergender"))
' Get senderuserinfo.htm message:: Name= "UserInfo" sent over the data
STRM = Trim (Request.Form ("UserInfo")) ' filter out spaces in UserInfo submitted content
STRMSG = replace (Strm,vbcrlf, "<Br>" & vbCrLf) ' Replaces <Br> with vbCrLf '
%>
<HTML><BODY>
<% ' Displays the obtained data%>
Name: <%= strname%><br><br>
Sex: <%= strgender%><br><br>
Message: <Br><Br>
<%= strm%><br><br>
</BODY></HTML>