phpnow、iis设置asp-php共存注意事项:
<virtualhost *>
servername club.hnyp.cn:80
serveralias club.hnyp.cn club.tradevnet.cn
proxypass / http://club.hnyp.cn:8080/
proxypassreverse / http://club.hnyp.cn:8080/
</virtualhost>
script_name=lcase(request.servervariables("script_name"))
server_name=lcase(request.servervariables("server_name"))
http_referer=lcase(request.servervariables("http_referer"))
if mid(http_referer,12,len(server_name))<>"club.tradevnet.cn" and mid(http_referer,8,len(server_name))<>"club.tradevnet.cn" and mid(http_referer,12,len(server_name))<>"club.hnyp.cn" and mid(http_referer,8,len(server_name))<>"club.hnyp.cn" and mid(http_referer,12,len(server_name))<>"club.tradevn" and mid(http_referer,8,len(server_name))<>"club.tradevn" then error("<li>来源错误!"&http_referer&"<li>系统无法识别您的来源!"&server_name&"<li>建议您关闭防火墙后再提交此信息!<li>")
end if
设置发送邮件时使用utf-8编码
jmail.charset = encodestring
使用foxmail接收时,查看源文件这部分正常可以看到。但在163的邮箱里, <head> ... </head>标签却被163邮件系统切掉,只有body标签内的部分,当然显示乱码。
各个邮箱服务商的编码是不一样的...
163的是gb2312,hotmail的是utf-8这是他们的默认编码
utf-8
--------------------------------------
<%
function gethttppage(url)
on error resume next
dim http
set http=server.createobject("msxml2.xmlhttp")
http.open "get",url,false
http.send()
if http.readystate<>4 then
exit function
end if
gethttppage=http.responsetext
set http=nothing
if err.number<>0 then
gethttppage="0"
response.write ""
err.clear
end if
end function
function bytestobstr(body,cset)
dim objstream
set objstream = server.createobject("adodb.stream")
objstream.type = 1
objstream.mode =3
objstream.open
objstream.write body
objstream.position = 0
objstream.type = 2
objstream.charset = cset
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
%>
gb2312
--------------------------------------
<%
function gethttppage(url)
on error resume next
dim http
set http=server.createobject("msxml2.xmlhttp")
http.open "get",url,false
http.send()
if http.readystate<>4 then
exit function
end if
gethttppage=bytestobstr(http.responsebody,"gb2312")
set http=nothing
if err.number<>0 then
response.write "<br>"
err.clear
end if
end function
function bytestobstr(body,cset)
dim objstream
set objstream = server.createobject("adodb.stream")
objstream.type = 1
objstream.mode =3
objstream.open
objstream.write body
objstream.position = 0
objstream.type = 2
objstream.charset = cset
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
%>
on error resume next
'发送注册邮件
topic=" hello,welcome to dianfen.net!"
dim agangurl
agangurl= "http://www.dianfen.net/v/template/reg.htm"
mailbody= gethttppage(agangurl)
mailbody= replace(mailbody,"{topic}",topic)
mailbody= replace(mailbody,"{userid}",userid)
mailbody= replace(mailbody,"{userpwd}",userpwd)
mailbody= replace(mailbody,"{companyname}",companyname)
set jmail=server.createobject("jmail.message")
jmail.charset="gb2312"
jmail.contenttype = "text/html"
jmail.from = mailsend
jmail.silent = true
jmail.logging = true
jmail.fromname = mailname
jmail.mailserverusername = mailusername
jmail.mailserverpassword = mailuserpass
jmail.addrecipient ""&trim(request("email"))&""
jmail.body=mailbody
jmail.subject=topic
if not jmail.send ( mailaddress ) then
sendmail=""
else
sendmail="ok"
end if
if sendmail="ok" then
sendmsg="<li>您的注册信息已经发往您的邮箱,请注意查收。</li>"
else
sendmsg="<li>由于系统错误,给您发送的注册资料未成功。</li>"
end if
ASP:
字段个数:rs.Fields.count
各个字段名:
for i=1 to rs.Fields.count
阅读全文……
修改(登陆)后转向代码 [ 2008-06-14 |
本站原创 ]
response.write "<script language=javascript>alert('删除成功!');window.location.href='product.asp';</script>"
response.write"<Script Language=Javascript>window.alert('管理员帐号输入有误。\n\n点击确定返回重新输入。');window.open ('/my','newwindow')</Script>"
阅读全文……
CSS属性 [ 2008-04-11 |
本站原创 ]
overflow:hidden;
overflow:auto;
display:inline;
阅读全文……
div中链接的3种方法 [ 2008-04-11 |
本站原创 ]
1.<div href="/web/test.asp?style=<%=rs("style")%>&uid=<%=session("UserName")%>" onClick="return newpage(this.href);"></div>
<script language= "javascript">
function newpage(htmlurl) {
var newwin=window.open(htmlurl,"newWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=10,left=10,width=1024,height=768");
阅读全文…… <%
Dim Strcontent
Dim regEx, Match, Matches, temp ' 创建变量。
Strcontent="中国Goldtimes123456"
Set regEx = New RegExp ' 创建正则表达式。
regEx.Pattern = "[0-9]" ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
regEx.Global = True ' 设置全程匹配。
Set Matches = regEx.Execute(Strcontent) ' 执行搜索。
For Each Match in Matches' 循环遍历Matches集合。
'Response.Write Match.Value & vbCRLF
temp = temp+Match.Value
Next
Response.Write temp
%>
-------------------------------------------------------------------------------------------------------------------------------------
regEx.Pattern = "[0-9]" ' 设置模式。
regEx.Pattern = "[a-zA-Z]" ' 设置模式。
阅读全文……
点击数统计方法总结(3) [ 2007-10-04 |
本站原创 ]
<SCRIPT language=javascript>
function addipgo(n,str)
{
ip.window.navigate("goto.asp?url=<%=url%>&userid="+str+"&id="+n);
}
</SCRIPT>
阅读全文……
点击数统计方法总结(2) [ 2007-10-04 |
本站原创 ]
<script type="text/javascript">
function o(url) { window.open(url,'',''); }
function adOnclick(id,userid,url) {document.getElementById('h').innerHTML = '<iframe width=0 height=0 frameborder=0 scrolling=no src="goto.asp?url=<%=url%>&id='+id+'&userid='+userid+'"></iframe>';o(url);}
</script>
阅读全文……
点击数统计方法总结(1) [ 2007-10-04 |
本站原创 ]
<SCRIPT language=javascript>
<!--
function urlOpen(id,url){
Frame_count.location.href="count.asp?id="+id;
阅读全文……
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 