The point is "Word-wrap:break-word" to remove it and then see it.
2. Batch input in the application of the database is more extensive, on the volume of the method also has many kinds of input.
Below I combine my practical application, talk about how I realize.
The main use is the concept of the set of form, by looping through all the data in the collection.
Considering everyone's convenience, I integrated it into a page.
The following are the specific code:
Batchinput.asp
<%
'#####################################
' File Function: Batch input data
' Author:myhon
' Date:2003-8-19
'#####################################
' Write data to the database
SUB WriteData ()
Dim reccnt,i
Dim Fieldname1,fieldname2,fieldname3
Dim conn
Dim sqlstr,connstr
Connstr= "Provider=sqloledb.1;initial catalog=mydatabase;data Source=myhon; User Id=sa; Password= "
Set Conn=server.createobject ("ADODB. Connection ")
Conn.Open ConnStr ' Establish a database connection
Reccnt=request.form ("Stu_num"). Count ' Get a total number of records
' Batch input data
For I=1 to Reccnt
Fieldname1=trim (Request.Form ("fieldName1") (i))
Fieldname2=trim (Request.Form ("fieldName2") (i))
Fieldname3=trim (Request.Form ("FieldName3") (i))
Sqlstr= "INSERT into myTable (FIELDNAME1,FIELDNAME2,FIELDNAME3) VALUES ('"
Sqlstr=sqlstr & fieldName1 & "', '"
Sqlstr=sqlstr & fieldName2 & "', '"
Sqlstr=sqlstr & FieldName3 & "')"
' Response.Write sqlstr
Conn.execute (SQLSTR)
Next
End SUB
' Display a batch input interface
SUB Inputdata ()
Dim reccnt,i
%>
<form name= "Bathinputdata" action= "" method= "POST" >
<%
Reccnt=cint (Request.Form ("reccnt"))
For I=1 to Reccnt
%>
<input type= "text" name= "fieldName1" >
<input type= "text" name= "fieldName2" >
<input type= "text" name= "FieldName3" >
<%
Next
%>
<br/>
<input type= "Submit" name= "action" value= "commit" >
</form>
<%
End SUB
' Specify how many records to be entered in batches
SUB Assignhowmuch ()
%>
<!------Specify how many records to input-------------->
<form name= "Form1" action= "" method= "POST" >
Number of records you want to input: <input type= "text" name= "reccnt" >
<input type= "Submit" name= "action" value= "next >>" >
</form>
<%
End SUB
If Request.Form ("action") = "Next >>" then
Call Inputdata () ' Show Batch Entry interface
ElseIf Request.Form ("action") = "Submit" then call WriteData () to bulk write data to the database
Else
Call Assignhowmuch () ' shows the interface of how many records are specified for entry
End If
%>
3. Take the dynamic download system as an example:
Open File softdown.asp in:
If request. QueryString ("ID") = "" Then
Response.Write "Cannot connect or does not specify download software"
Response.End
End If
Above or below, add the following code
Dim strreferer,domain,spldomain,ishttp
Ishttp=false
' Site Download the list of system URLs, do not bring http://
Domain= "sron.net,61.156.14.223,61.156.14.227"
Spldomain=split (Domain, ",")
Strreferer=request.servervariables ("Http_referer")
For iii. = 0 To UBound (spldomain)
If InStr (Strreferer,trim (Spldomain (iii))) >0 then Ishttp=true
Next
If IsNull (strreferer) or Ishttp=false Then
Response.Write "Download links from other sites, this is not allowed, <a href=" "./" > Please go to the site page before downloading. </a> "
CloseDatabase
Response.End
End If
Site Download system URL list is to visit your download channel URL of the domain name, such as your download channel can use more than one URL to access, so here separated by commas.
4. Frequently asked questions that cannot be written to cookies
1. Determine your Response.cookie code before the first 2. Set the expiration date of the Cookies Response.cookie ("CookieName"). expires = Expiresdate;
To set the request for a cookie specify the path:
That means that after you write your cookie, the page in the specified path has the right to get the cookie.
For example, specify the path Response.cookie ("CookieName"). Path = "Http://www.domain.com/path"
Then only pages in the path directory can get Request.cookie ("CookieName")
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