找回密码
 加入
搜索
查看: 2119|回复: 0

给脚本计费

[复制链接]
发表于 2010-3-3 15:42:16 | 显示全部楼层 |阅读模式
本帖最后由 foboy 于 2010-3-3 15:45 编辑

本来俺是给人做脚本收点小钱的,后来觉得累,不如写几个好点的脚本按时间收费, 就做了个脚本计费的功能。现在拿出来和大家分享一下。
该功能需要用我的网站作为服务器实现按时间给脚本计费。接口如下:
以下接口直接在浏览器中访问时会重定向到本站首页,必须用POST方式访问才会返回正常数据!
注册接口:
http://maijiaoben.com/xyq/p_usersign.php?user=&pass=&spass=&systeminfo=&softid=
user为用户名,pass为密码,spass为第二密码(用于找回),systeminfo为系统硬件信息,softid为软件的代码(用来防止一个用户能登陆多种软件)
返回值:
注册成功:success
有同名或者本机已经注册过用户:sameuser
其他错误:error
登陆接口:
http://maijiaoben.com/xyq/p_userlogin.php?user=&pass=&systeminfo=&softid=
返回值:
diffsoft:软件序列号不符
diff:硬件信息不符
guoqi:用户余额不足
nouser:无此用户
返回空字符为其他错误
登陆成功则返回: 天数,登陆次数
用户自己再拆分此字符串
用本接口可实现按照天、周、月和次数为脚本计费。
另外还有用户充值、解绑计算机等接口,在此就不公布了。本来想把软件也发出来,但是上面有我的广告图片,发出来恐怕AU3论坛的管理员不高兴,就不发啦。
发一个登陆的例子:(add_msg()是我更新GUI的自定义函数)
        $_to_send_info = "user=" & encode_url($re_user) & "&pass=" & $re_pass & "&spass=" & $re_pass_re & "&systeminfo=" & $systeminfo & "&softid=" & $softid
        $_the_result = _post_info_to_web($web_server & "p_usersign.php", $_to_send_info)
        Switch $_the_result
                Case "success"
                        add_msg("注册成功!")
                        GUICtrlSetData($Input_user,$re_user)
                        GUICtrlSetData($Input_password,$re_pass)
                        Login_user()
                Case "sameuser"
                        add_msg("有同名用户存在或者本机注册过用户!")
                        Return
                Case "error"
                        add_msg("注册失败,请重试!")
                        Return
        EndSwitch
POST服务器的函数:
Func _post_info_to_web($_to_post_url = "", $_to_post_info = "", $_to_post_referer = "")
        Local $_post_result
        If $_to_post_url == "" Then
                SetError(1)
                Return
        EndIf
        If $_to_post_referer == "" Then $_to_post_referer = $_to_post_url
        $oHTTP = ObjCreate("microsoft.xmlhttp")
        $oHTTP.Open("post", $_to_post_url, False)
        $oHTTP.setRequestHeader("Cache-Control", "no-cache")
        $oHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
        $oHTTP.setRequestHeader("Referer", "http://maijiaoben.com")
        $oHTTP.setRequestHeader("Content-Length", StringLen($_to_post_info))
        $oHTTP.Send($_to_post_info)
        $_post_result = BinaryToString($oHTTP.responseText)
        If StringLen($_post_result) > 20 Then
                $_post_result = ""
                SetError(1)
        EndIf
        Return $_post_result
EndFunc   ;==>_post_info_to_web
附上两张截图,我已经尽量把LOGO图片少露出来了,管理员大人千万不要再说我带有图片广告了。谢谢。




您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-14 02:52 , Processed in 0.073927 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表