一个在线代理的转向功能有点问题,请教一下,谢谢

cander88 2008-04-01 10:13:03
首先我贴一下代码
1.index.htm 是选择镜像的文件
1.base.asp 是负责编码的文件
2.url.asp 是负责转向的文件

index.htm 其中关键如下:
<form method="post" action="url.asp" target="new">
<strong><font size="4" color="#000000">请输入要访问的URL地址:</font></strong>
<input type="text" name="url" value="http://www.google.com" class="inps" style="width:188; height:24; font-size:12pt; font-family:Arial" size="1" />  <font color="#000000" size="4"><strong>选择服务器:</strong></font>
<select size="1" name="proxylist">
<option selected value="http://www.dontfilter.us/index.php?q">一号服务器
</option>
<option value="http://www.cikez.net/index.php?q">二号服务器</option>
<option value="http://www.evadefilter.com/index.php?q">三号服务器</option>
<option value="http://www.proxyeye.com/index.php?q">四号服务器</option>
<option value="http://www.surfingfreedom.info/browse.php?u">五号服务器
</option>
<option value="http://www.notyourip.com/index.php?q">六号服务器</option>
<option value="http://www.sneakcentral.com/index.php?q">七号服务器</option>
<option value="http://www.thebypass.net/index.php?q">八号服务器</option>
<option value="http://www.proxybat.com/index.php?q">九号服务器</option>
<option value="http://www.proxydoo.com/index.php?q">十号服务器</option>
</select>   
<input type="submit" class="inp_text" value="提交浏览" name="go" style="font-family: 宋体; font-size: 12pt" /> </form>


url.asp 其中关键如下:

<!--#include file="base.asp" -->
<% dim inp,encode,list
inp = request.FORM("url")
list=request.FORM("proxylist")
encode = base64Encode(inp)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IS Connected to the... Free Web Proxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
<meta http-equiv="refresh" content="0;url=<%=list%>=<%=encode%>"> 这里是编码URL的地方
<meta name="keywords" content="Free Web Proxy|Web Proxy|php-proxy|cgi-proxy"/>
<meta name="description" content="The Web Proxy Is Very Good"/>


base.asp 其中代码如下:
<%
Function Base64encode(asContents)
sBASE_64_CHARACTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim lnPosition
Dim lsResult
Dim Char1
Dim Char2
Dim Char3
Dim Char4
Dim Byte1
Dim Byte2
Dim Byte3
Dim SaveBits1
Dim SaveBits2
Dim lsGrouPBinary
Dim lsGroup64
If Len(asContents) Mod 3 > 0 Then asContents = asContents & String(3 - (Len(asContents) Mod 3), " ")
lsResult = ""
For lnPosition = 1 To Len(asContents) Step 3
lsGroup64 = ""
lsGroupBinary = Mid(asContents, lnPosition, 3)
Byte1 = Asc(Mid(lsGroupBinary, 1, 1)): SaveBits1 = Byte1 And 3
Byte2 = Asc(Mid(lsGroupBinary, 2, 1)): SaveBits2 = Byte2 And 15
Byte3 = Asc(Mid(lsGroupBinary, 3, 1))
Char1 = Mid(sBASE_64_CHARACTERS, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = Mid(sBASE_64_CHARACTERS, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = Mid(sBASE_64_CHARACTERS, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
Char4 = Mid(sBASE_64_CHARACTERS, (Byte3 And 63) + 1, 1)
lsGroup64 = Char1 & Char2 & Char3 & Char4
lsResult = lsResult + lsGroup64
Next
Base64encode = lsResult
End Function
%>

问题也知道是怎么样,每次都是编码完成后的URL编码后面都是多一个小写的g 字, 而导致整个URL转向POST到代理站的时候好象都多一个空格,而无法正常访问!求解


...全文
84 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧