免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: bbenyu
打印 上一主题 下一主题

请教一个解决问题的思想。 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2004-12-08 18:27 |只看该作者

请教一个解决问题的思想。

以下是我用ASP写的与取google.com关键字有关代码片段!供参考.

dim getStr
getStr        = Request.ServerVariables("HTTP_REFERER"
       
if 0 < len(trim(getStr)) then       
        dim keyWord, value, j, iNeed
        result        = split(getStr,"?"        ' 以?为符号,被划分为二部分
       
        if (isArray(result)) then       
                resultMore        = split(result(UBound(result)),"&"        ' 从result中取出第一部分并以&为符号被划分为四部分,
                if(isArray(resultMore)) then                       
                        for j=LBound(resultMore) to UBound(resultMore)                               
                                if "q"        = left(resultMore(j),1) then        ' 还要看一下是不是q开头的,其它部分以此类推;
                                        iNeed        = resultMore(j)        ' 取得以Q串
                                        exit for
                                end if
                        next
                end if               
        else               
                response.write "无法取得您要的字串"                       
        end if

        ' 分析出Q串的值
        values        = split(iNeed,"="
       
        if (isArray(values)) then               
                keyword        = values(lbound(values))
                value        = values(ubound(values))
        end if
       
        ' 模糊匹配 q 关键值;
        if (("%E7%89" = left(value,6)) OR ("%E9%B1" = left(value,6)) OR ("%E7%99" = left(value,6))) then
                Response.redirect "http://www.zhpf.com.cn"
        elseif (("%E5%A4"        = left(value,6)) OR ("%E6%8A" = left(value,6))) then
                Response.redirect "http://www.gotosleep120.com"
        elseif ("%E9%AB%98%E8%A1%80%E5%8E%8B" =value) then
                Response.redirect "http://www.junkhospital.com/gxy/"
        else
                Response.write "遇到未知关键字...执行停止!"
        end if
       
else
        Response.write "请从GOOGLE查找进入"
end if

论坛徽章:
0
12 [报告]
发表于 2006-12-27 16:14 |只看该作者
很高深啊.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP