The ASP file that turns the homepage into the static HTML page application skill

Source: Internet
Author: User
Tags html page servervariables trim
This program can only turn the homepage into static! (True to one page)

Upload the createhtml.asp file to your space to store the first file (index.asp) in the directory
Enter the URL directly open createhtml.asp to the prompt operation on it
If no success can be createhtml.asp renamed try (such as: Change to z.asp) input URL directly open z.asp
This document can be renamed without affecting the operation
Copy Code code as follows:

<%
If request. QueryString ("action") = "OK" then
Dim Kk,url,http,reurl
URL =trim (Request. Form ("url")
If Url= "" Then
Url= "Http://www.jb51.net"
End If
Kk=trim (Request. Form ("ad")
If kk= "" Then
kk= "Index.html"
End If
Reurl=trim (Request. Form ("Reurl"))
Set Http=server.createobject ("Microsoft." &AMP;CHR (& "Mlhttp")
Http.open "Get", Url,false
Http.send ()
Set objstream = Server.CreateObject ("ADODB. Stream ")
objStream.Type = 1
objStream.Open
Objstream.write Http.responsebody
Objstream.savetofile Server.MapPath (KK), 2
Response.Write "<script language= ' JavaScript ' >"
Response.Write "Alert (' Publish Success ');"
Response.Write "Location.href= '" &reurl& "';"
Response.Write "</script>"
Else
%>
<style type= "Text/css" >
<!--
. STYLE1 {
font-size:12px;
Color: #FF0000;
}
. STYLE2 {
Color: #0000FF;
font-size:12px;
}
-->
</style>

<form id= "Form1" Name= "Form1" "method=" Post "action=" http://<%=request. ServerVariables ("Http_host") &request. ServerVariables ("Script_name")%>?action=ok ">
<table><tr><td>
<span class= "STYLE2" > to a static URL: </span></td><td><input name= "url" type= "text" id= "url" Value= "Http://www.jb51.net"/>
<span class= "STYLE1" > For example http://www.jb51.net native files http://localhost/</span></td>
</tr>
<tr><td><span class= "STYLE2" > Storage path:</span></td><td>
<input name= "ad" type= "text" id= "ad" value= "index.htm"/>
<span class= "STYLE1" > such as index.html is saved as a index.html</span></td> in the same directory as this file
</tr>
<tr>
<td><span class= "STYLE2" > Turn to static after the need to jump to:</span></td>
<td>
<input name= "Reurl" type= "text" id= "Reurl" value= "index.htm"/>
<span class= "STYLE1" > after the static, there will be a reminder box and then go to the page you completed </span></td>
</tr>
<tr><td><div align= "Right" >
</div></td><td><input type= "Submit" name= "Submission" value= "submitted"/></td>
</tr></table>
</form>
<%end if%>
<span class= "STYLE1" > This document can be renamed without affecting running </span>
Related Article

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.