﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>PHP博客-鱼有所思,鱼有所悟</title><link>http://www.phpweblog.net/kiyone/</link><description>做个不错的人，微笑面对人生</description><language>zh-cn</language><lastBuildDate>Fri, 19 Mar 2010 09:46:23 GMT</lastBuildDate><pubDate>Fri, 19 Mar 2010 09:46:23 GMT</pubDate><ttl>60</ttl><item><title>需求分析文档都包括哪些内容</title><link>http://www.phpweblog.net/kiyone/archive/2010/03/12/7131.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 12 Mar 2010 09:28:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2010/03/12/7131.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/7131.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2010/03/12/7131.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/7131.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/7131.html</trackback:ping><description><![CDATA[<span style="FONT-SIZE: 14pt">首先你要找那些让你提交这些报告的人，问明白他们说的这些报告究竟需要涉及什么内容，给什么人看，格式和文档的风格要求是什么。如果他们不能告诉你一个满意的答案，就没有必要给他们一个他们自己都不知道想不想要的东西。 &nbsp; <br>&nbsp; 而实际上需求分析报告可以说是文档体系中最没有必要存在的。当然我不是说需求分析不重要，而是说需求分析太重要，是一个报告所不能容纳的，而是要有一个包括数个不同内容体系的文档系统。而如果你的项目根本就没有那么多的资金和资源，你一般就不要动用这样一个庞大的系统。你在这个时候只需要随时记录你的想法，列出你的关注点和解决的想法。而当然这个系统虽然庞大，但是还有很多线索要你去掌握它们的建造。首先这个系统需要有一个业务目标分析，也就你的这个系统要达到的业务目标，要结合具体的企业环境进行系统分析和论证，这个文档的阅读者基本上属于最高级次的决策者。还要有一个技术目标分析，也就是你的这个项目将解决什么具体的技术问题，这个部分也十分的复杂，基本上需要行业专家认真地分析，这个文档的阅读者属于管理者。还要有一个技术实现的报告，也就是你需要为完成这个项目动用什么技术，主要是你必须说出在这个项目的几种可使用技术方案中你为什么要选择你目前的这种，这个文档的阅读者基本上就是相关的技术人员。而同时你还需要一个风险分析的报告，把这个文档要针对业务/技术/实现这三个层次的问题中要遇到的各种风险进行分析。这属于基本的需求分析的基础文档系统。 &nbsp; <br>&nbsp; 然后你还需要面对你的具体的情况进行具体的项目的规划分析。首先如果你的项目是一个开发型的项目，你就有必要对你的业务目标和技术目标的实现进行一种设计。这个工作需要大量的市场和人类学知识。其次你还需要对你上面这个需求的设计进行分析，以把其转化为开发者可以接受的文档格式。然后你还需要对这些需求进行具体的粒度化的划分，将其细化为一些原子态的互相联系的部分。在此基础上你还需要对这些具体的技术实现进行规划，找出最重要的和最有难度的部分。同时这个层次的风险分析也需要有一个单独的文档说明。 &nbsp; <br>&nbsp; 最后你还需要对实现中具体的细节问题组织你的需求分析文档。这些问题包括，你使用的具体技术需要什么要求的人员和设备等等资源。你的需求需要如果进行测试，以保证你的这些需求能够被真正的贯彻。你的系统需要如何部署在你的业务环节中。你的人员培训需要采用什么措施。这些问题都需要有专门的文档，而且也都是需求分析方面的。 &nbsp; <br>&nbsp; 基本上这样一个系统要有10份以上的文档，而关键在于不同的问题应该在不同的文档中说明，同时你还必要在这些文档的相互关系中做出一种标注。这样一个工程，基本上需要一个团队来专门的进行协调和维护。至于书写则是一个文档就要一个小组，同时还必须有一个系统的管理小组。在这样一个文档系统中，基本上可以保证你所有的关注都在你的文档中体现了。 &nbsp; <br>&nbsp; 当然这样的文档系统我估计你在国内根本就看不到，国外也难找。而国内常见的情况是，这些文档和垃圾的地位一样，基本上都是人为的制造的无用的浪费时间的和精力的废纸。 &nbsp; <br>&nbsp; 还是回到最初的问题，你最好还是先去问问需要这些文档的人，他们究竟是要什么，有什么具体的要求，肯为这些文档出什么价钱。如果他们不能告诉你，你就只需要为自己建立一个文档，当然有的时候你会觉得自己不需要任何文档，那么你不需要好了。没有任何文档也不说明什么，到处都是文档倒是肯定的说明这个组织水准和开发能力十分的低劣。 </span>
<img src ="http://www.phpweblog.net/kiyone/aggbug/7131.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2010-03-12 17:28 <a href="http://www.phpweblog.net/kiyone/archive/2010/03/12/7131.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>php的IP转换成整型函数ip2long()易出现负数</title><link>http://www.phpweblog.net/kiyone/archive/2010/02/09/7092.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Tue, 09 Feb 2010 03:31:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2010/02/09/7092.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/7092.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2010/02/09/7092.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/7092.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/7092.html</trackback:ping><description><![CDATA[<div id=postmessage_824 class=t_msgfont>php中将IP转换成整型的函数ip2long（）容易出现问题，在IP比较大的情况下，会变成负数。<br>如下<br>&lt;?php<br>$ip = "192.168.1.2";<br>$ip_n = ip2long($ip);<br>echo $ip_n;&nbsp; &nbsp;&nbsp; &nbsp;//得到 -1062731518<br>?&gt;<br>由于IP转换成的整型值太大超出了整型的范围，所以变成负数。需写成$ip_n = bindec(decbin(ip2long($ip)));这样便可得到无符号的整型数，如下<br>&lt;?php<br>$ip = "192.168.1.2";<br>$ip_n = bindec(decbin(ip2long($ip)));<br>echo $ip_n;&nbsp; &nbsp;&nbsp; &nbsp;//得到 3232235778<br>?&gt;</div>
<img src ="http://www.phpweblog.net/kiyone/aggbug/7092.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2010-02-09 11:31 <a href="http://www.phpweblog.net/kiyone/archive/2010/02/09/7092.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Zend Studio For Eclipse实用快捷键</title><link>http://www.phpweblog.net/kiyone/archive/2009/12/16/7004.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Wed, 16 Dec 2009 01:24:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/12/16/7004.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/7004.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/12/16/7004.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/7004.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/7004.html</trackback:ping><description><![CDATA[<div id=articlebody>Ctrl+1 快速修复(最经典的快捷键,就不用多说了)<br>Ctrl+D: 删除当前行<br>Ctrl+Alt+&#8595; 复制当前行到下一行(复制增加)<br>Ctrl+Alt+&#8593; 复制当前行到上一行(复制增加)<br>Alt+&#8595; 当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了)<br>Alt+&#8593; 当前行和上面一行交互位置(同上)<br>Alt+&#8592; 前一个编辑的页面<br>Alt+&#8594; 下一个编辑的页面(当然是针对上面那条来说了)<br>Alt+Enter 显示当前选择资源(工程,or 文件 or文件)的属性<br>Shift+Enter 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置,不一定是最后)<br>Shift+Ctrl+Enter 在当前行插入空行(原理同上条)<br>Ctrl+Q 定位到最后编辑的地方<br>Ctrl+L 定位在某行 (对于程序超过100的人就有福音了)<br>Ctrl+M 最大化当前的Edit或View (再按则反之)<br>Ctrl+/ 注释当前行,再按则取消注释<br>Ctrl+O 快速显示 OutLine<br>Ctrl+T 快速显示当前类的继承结构<br>Ctrl+W 关闭当前Editer<br>Ctrl+K 参照选中的Word快速定位到下一个<br>Ctrl+E 快速显示当前Editer的下拉列表(如果当前页面没有显示的用黑体表示)<br>Ctrl+/(小键盘) 折叠当前类中的所有代码<br>Ctrl+&#215;(小键盘) 展开当前类中的所有代码<br>Ctrl+Space 代码助手完成一些代码的插入(但一般和输入法有冲突,可以修改输入法的热键,也可以暂用Alt+/来代替)<br>Ctrl+Shift+E 显示管理当前打开的所有的View的管理器(可以选择关闭,激活等操作)<br>Ctrl+J 正向增量查找(按下Ctrl+J后,你所输入的每个字母编辑器都提供快速匹配定位到某个单词,如果没有,则在stutes line中显示没有找到了,查一个单词时,特别实用,这个功能Idea两年前就有了)<br>Ctrl+Shift+J 反向增量查找(和上条相同,只不过是从后往前查)<br>Ctrl+Shift+F4 关闭所有打开的Editer<br>Ctrl+Shift+X 把当前选中的文本全部变为小写<br>Ctrl+Shift+Y 把当前选中的文本全部变为小写<br>Ctrl+Shift+F 格式化当前代码<br>Ctrl+Shift+P 定位到对于的匹配符(譬如{}) (从前面定位后面时,光标要在匹配符里面,后面到前面,则反之) </div>
<img src ="http://www.phpweblog.net/kiyone/aggbug/7004.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-12-16 09:24 <a href="http://www.phpweblog.net/kiyone/archive/2009/12/16/7004.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>php 字符串反转</title><link>http://www.phpweblog.net/kiyone/archive/2009/11/19/6962.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 19 Nov 2009 07:50:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/11/19/6962.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6962.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/11/19/6962.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6962.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6962.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;$str = "00011";<br>&nbsp;&nbsp;&nbsp; $len=strlen($str);<br>&nbsp;&nbsp;&nbsp; $i = $len;<br>&nbsp;&nbsp;&nbsp; while ($i &gt; 0)<br>&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $i=$i-1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $reverse_str .= substr($str, $i, 1);<br>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; $reverse_str == "11000";
<img src ="http://www.phpweblog.net/kiyone/aggbug/6962.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-11-19 15:50 <a href="http://www.phpweblog.net/kiyone/archive/2009/11/19/6962.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>多选框的排列</title><link>http://www.phpweblog.net/kiyone/archive/2009/11/18/6960.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Wed, 18 Nov 2009 04:48:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/11/18/6960.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6960.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/11/18/6960.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6960.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6960.html</trackback:ping><description><![CDATA[&lt;tr&gt; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &lt;td &nbsp; valign="top"&gt;具体设施：&lt;/td&gt; &nbsp; <br>&nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="5" &nbsp; &gt;电话 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="6" &nbsp; &gt;淋浴器 &nbsp; &nbsp; &nbsp; <br>&nbsp; input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="7" &nbsp; &gt;冰箱 &nbsp; <br>&nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="8" &nbsp; &gt;彩电 &nbsp; <br>&nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="9" &nbsp; &gt;空调 &nbsp; <br>&nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="10" &nbsp; &gt;洗衣机 &nbsp; <br>&nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="11" &nbsp; &gt;微波炉 &nbsp; <br>&nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="12" &nbsp; &gt;饮水机 &nbsp; <br>&nbsp; &lt;input &nbsp; type="checkbox" &nbsp; name="r_DetailEquip[]" &nbsp; value="13" &nbsp; &gt;简单家具 &nbsp; <br>&nbsp; &lt;/tr&gt; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 把以上用PHP程序排成象下面下排列 一排四个： &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; []电话 &nbsp; []淋浴器 &nbsp; []冰箱[] &nbsp; 彩电<br>&nbsp;&nbsp;&nbsp; []洗衣机 &nbsp; []微波炉 &nbsp; []饮水机 &nbsp; []简单家具&nbsp;&nbsp;<br><br><br>&lt;table &nbsp; width="100%" &nbsp; border="0" &nbsp; cellspacing="0" &nbsp; cellpadding="0"&gt; &nbsp; <br>&nbsp; &lt;tr&gt; &nbsp; <br>&nbsp; &lt;? &nbsp; <br>&nbsp; for($i=1;$i&lt;=8;$i++){ &nbsp; <br>&nbsp; &nbsp; &nbsp; if($i%4 &nbsp; == &nbsp; 0){ &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &nbsp; "&lt;/tr&gt;&lt;tr&gt;"; &nbsp; <br>&nbsp; &nbsp; &nbsp; } &nbsp; <br>&nbsp; &nbsp; &nbsp; echo &nbsp; "&lt;td&gt;$i&lt;/td&gt;"; &nbsp; <br>&nbsp; } &nbsp; <br>&nbsp; ?&gt; &nbsp; <br>&nbsp; &lt;/tr&gt;&nbsp;&nbsp; <br>&lt;/table&gt;<br>
<img src ="http://www.phpweblog.net/kiyone/aggbug/6960.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-11-18 12:48 <a href="http://www.phpweblog.net/kiyone/archive/2009/11/18/6960.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js获取本机ip地址、mac地址、机器名</title><link>http://www.phpweblog.net/kiyone/archive/2009/11/09/6946.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Mon, 09 Nov 2009 08:42:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/11/09/6946.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6946.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/11/09/6946.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6946.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6946.html</trackback:ping><description><![CDATA[<p>只在IE中适用<br><br>&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;WMI Scripting HTML&lt;/TITLE&gt; <br>&lt;META http-equiv=Content-Type content="text/html; charset=gb2312"&gt; <br>&lt;SCRIPT language=JScript event="OnCompleted(hResult,pErrorObject, pAsyncContext)" for=foo&gt; <br>document.forms[0].txtMACAddr.value=unescape(MACAddr); <br>document.forms[0].txtIPAddr.value=unescape(IPAddr); <br>document.forms[0].txtDNSName.value=unescape(sDNSName); <br>//document.formbar.submit(); <br>&lt;/SCRIPT&gt; </p>
<p>&lt;SCRIPT language=JScript event=OnObjectReady(objObject,objAsyncContext) for=foo&gt; <br>if(objObject.IPEnabled != null &amp;&amp; objObject.IPEnabled != "undefined" &amp;&amp; objObject.IPEnabled == true) <br>{ <br>&nbsp;&nbsp;&nbsp; if(objObject.MACAddress != null &amp;&amp; objObject.MACAddress != "undefined") <br>&nbsp;&nbsp;&nbsp; MACAddr = objObject.MACAddress; <br>&nbsp;&nbsp;&nbsp; if(objObject.IPEnabled &amp;&amp; objObject.IPAddress(0) != null &amp;&amp; objObject.IPAddress(0) != "undefined") <br>&nbsp;&nbsp;&nbsp; IPAddr = objObject.IPAddress(0); <br>&nbsp;&nbsp;&nbsp; if(objObject.DNSHostName != null &amp;&amp; objObject.DNSHostName != "undefined") <br>&nbsp;&nbsp;&nbsp; sDNSName = objObject.DNSHostName; <br>} <br>&lt;/SCRIPT&gt; </p>
<p>&lt;META content="MSHTML 6.00.2800.1106" name=GENERATOR&gt;&lt;/HEAD&gt; <br>&lt;BODY&gt; <br>&lt;OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT&gt;&lt;/OBJECT&gt; <br>&lt;OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223&gt;&lt;/OBJECT&gt; <br>&lt;SCRIPT language=JScript&gt; <br>var service = locator.ConnectServer(); <br>var MACAddr ; <br>var IPAddr ; <br>var DomainAddr; <br>var sDNSName; <br>service.Security_.ImpersonationLevel=3; <br>service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration'); <br>&lt;/SCRIPT&gt; </p>
<p>&lt;FORM id=formfoo name=formbar action=NICPost.asp method=post&gt;<br>&lt;INPUT name=txtMACAddr&gt;&lt;INPUT name=txtIPAddr&gt;&lt;INPUT name=txtDNSName&gt;<br>&lt;/FORM&gt;<br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br></p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/6946.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-11-09 16:42 <a href="http://www.phpweblog.net/kiyone/archive/2009/11/09/6946.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用php取得客户端操作系统和浏览器信息</title><link>http://www.phpweblog.net/kiyone/archive/2009/11/09/6945.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Mon, 09 Nov 2009 08:23:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/11/09/6945.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6945.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/11/09/6945.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6945.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6945.html</trackback:ping><description><![CDATA[<table cellSpacing=0 cellPadding=0>
    <tbody>
        <tr>
            <td id=postmessage_632346 class=t_msgfont><br>&lt;?php<br><br>/*<br>作用：取得客户端信息<br>参数：<br>返回：指定的资料<br>使用：<br>&nbsp; &nbsp; &nbsp; &nbsp; $code = new client;<br>&nbsp; &nbsp; &nbsp; &nbsp; 1、浏览器：$str = $code-&gt;getBrowse();<br>&nbsp; &nbsp; &nbsp; &nbsp; 2、IP地址：$str = $code-&gt;getIP();<br>&nbsp; &nbsp; &nbsp; &nbsp; 3、IP地址资料：$str = $code-&gt;getIPaddres();<br>&nbsp; &nbsp; &nbsp; &nbsp; 4、操作系统：$str = $code-&gt;getOS();<br>*/<br><br>class client<br>{<br><br>&nbsp; &nbsp; &nbsp; &nbsp; function getBrowse()<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Agent = $_SERVER['HTTP_USER_AGENT'];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browser = '';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = '';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Browser = array('Lynx', 'MOSAIC', 'AOL', 'Opera', 'JAVA', 'MacWeb', 'WebExplorer', 'OmniWeb');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for($i = 0; $i &lt;= 7; $i ++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strpos($Agent, $Browsers[$i])){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browser = $Browsers[$i];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = '';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(ereg('Mozilla', $Agent) &amp;&amp; !ereg('MSIE', $Agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode('(', $Agent);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Part = $temp[0];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode('/', $Part);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $temp[1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode(' ', $browserver);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $temp[0];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = preg_replace('/([\d\.]+)/', '\\1', $browserver);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $browserver;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browser = 'Netscape Navigator';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(ereg('Mozilla', $Agent) &amp;&amp; ereg('Opera', $Agent)) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode('(', $Agent);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Part = $temp[1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode(')', $Part);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $temp[1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode(' ', $browserver);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $temp[2];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = preg_replace('/([\d\.]+)/', '\\1', $browserver);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $browserver;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browser = 'Opera';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(ereg('Mozilla', $Agent) &amp;&amp; ereg('MSIE', $Agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode('(', $Agent);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Part = $temp[1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode(';', $Part);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Part = $temp[1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = explode(' ', $Part);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $temp[2];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = preg_replace('/([\d\.]+)/','\\1',$browserver);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browserver = $browserver;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browser = 'Internet Explorer';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($browser != ''){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browseinfo = $browser.' '.$browserver;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $browseinfo = false;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $browseinfo;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; function getIP ()<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (getenv('HTTP_CLIENT_IP')) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip = getenv('HTTP_CLIENT_IP');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else if (getenv('HTTP_X_FORWARDED_FOR')) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip = getenv('HTTP_X_FORWARDED_FOR');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else if (getenv('REMOTE_ADDR')) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip = getenv('REMOTE_ADDR');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip = $_SERVER['REMOTE_ADDR'];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $ip;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; function getIPaddres ($ip = '')<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($ip == ''){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip = $this-&gt;getIP();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($ip == '127.0.0.1'){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $ip_addres = '本地机器';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RECORDLENGTH = 17+22+13+47+12+1;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ret = ereg('^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$', $ip, $IPSection);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($ret == false){$ip_addres = 'IP地址有错';}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for($i = 1; $i &lt;= 4; $i ++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($IPSection[$i] &gt; 255){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip_addres = 'IP地址有错';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $thisip .= sprintf('%03.0f', $IPSection[$i]). (($i&lt;4) ? '.' : '');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fp= fopen($this-&gt;obj['rootDir'].'data/ip.txt', 'rb');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($fp == NULL){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip_addres = 'IP记录文件打开出错';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fseek($fp, 0, SEEK_END);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DATAFIELDBEGIN = 0xc2;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RecordCount = floor((ftell($fp)-$DATAFIELDBEGIN)/$RECORDLENGTH);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($RecordCount &lt;= 1){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip_addres = 'IP记录文件打开出错';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RangB = 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RangE = $RecordCount;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while($RangB&lt;$RangE-1){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RecNo = floor(($RangB+$RangE)/2);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fseek($fp,$RecNo*$RECORDLENGTH+$DATAFIELDBEGIN, SEEK_SET);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $buf = fread($fp, $RECORDLENGTH);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strlen($buf) == 0){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $StartIP = (substr($buf, 0, 17));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $EndIP = trim(substr($buf, 17, 22));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Country = trim(substr($buf, 17+22, 13));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Local = trim(substr($buf, 17+22+13, 47));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (strcmp($thisip, $StartIP) &gt;= 0 &amp;&amp; strcmp($thisip, $EndIP)&lt;=0){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strcmp($thisip, $StartIP) &gt; 0){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RangB = $RecNo;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $RangE = $RecNo;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!($RangB &lt; $RangE - 1)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip_addres= '未知地址！';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip_addres = $Country;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ip_addres .= $Local;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose($fp);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $ip_addres;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; function getOS ()<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $agent = $_SERVER['HTTP_USER_AGENT'];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = false;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (eregi('win', $agent) &amp;&amp; strpos($agent, '95')){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows 95';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('win 9x', $agent) &amp;&amp; strpos($agent, '4.90')){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows ME';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('win', $agent) &amp;&amp; ereg('98', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows 98';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('win', $agent) &amp;&amp; eregi('nt 5.1', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows XP';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('win', $agent) &amp;&amp; eregi('nt 5', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows 2000';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('win', $agent) &amp;&amp; eregi('nt', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows NT';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('win', $agent) &amp;&amp; ereg('32', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Windows 32';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('linux', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Linux';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('unix', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Unix';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('sun', $agent) &amp;&amp; eregi('os', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'SunOS';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('ibm', $agent) &amp;&amp; eregi('os', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'IBM OS/2';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('Mac', $agent) &amp;&amp; eregi('PC', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'Macintosh';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('PowerPC', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'PowerPC';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('AIX', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'AIX';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('HPUX', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'HPUX';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('NetBSD', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'NetBSD';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('BSD', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'BSD';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (ereg('OSF1', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'OSF1';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (ereg('IRIX', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'IRIX';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('FreeBSD', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'FreeBSD';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('teleport', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'teleport';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('flashget', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'flashget';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('webzip', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'webzip';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (eregi('offline', $agent)){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $os = 'offline';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;$os = 'Unknown';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $os;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>} <br><br>?&gt;<br></td>
        </tr>
    </tbody>
</table>
<img src ="http://www.phpweblog.net/kiyone/aggbug/6945.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-11-09 16:23 <a href="http://www.phpweblog.net/kiyone/archive/2009/11/09/6945.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关闭管理窗口就自动登出</title><link>http://www.phpweblog.net/kiyone/archive/2009/11/09/6944.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Mon, 09 Nov 2009 02:54:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/11/09/6944.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6944.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/11/09/6944.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6944.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6944.html</trackback:ping><description><![CDATA[<p>&lt;script&gt;<br>function CloseOpen() <br>{<br>&nbsp; &nbsp; &nbsp;if(event.clientX&lt;=0 &amp;&amp; event.clientY&lt;0)&nbsp;<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; //" 這裡寫操作"<br>&nbsp; &nbsp; &nbsp;}<br>}<br>&lt;/script&gt;<br>&lt;body onunload="CloseOpen()"&gt;</p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/6944.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-11-09 10:54 <a href="http://www.phpweblog.net/kiyone/archive/2009/11/09/6944.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>php的ajax框架xajax入门与试用</title><link>http://www.phpweblog.net/kiyone/archive/2009/10/30/6907.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 30 Oct 2009 09:31:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/10/30/6907.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6907.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/10/30/6907.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6907.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6907.html</trackback:ping><description><![CDATA[<p>一、xajax与其它ajax框架的比较<br><br>xajax功能很简单，但很灵活！~它不象其它一些大的框架，功能确实强大，但执行速度不敢恭维。。功能虽多，但不够灵活。api多，学起来简直如同学习一门新的语言。<br><br>二、xajax功能介绍<br><br>xajax的功能比较简单，但就因为简单，所以灵活。同时，这也要求使用者要对javascrīpt / vbs 客户端脚本有一定的了解。因为它的功能是比较活的。可以说单纯使用xajax，什么也做不出，但配合js / vbs 又什么都做的出。<br><br>xajax主要是使用xajaxResponse这个类，它提供了一些方法，举例如下：<br><br>1、addAlert($sMsg) <br>弹出警告<br><br>2、addscrīpt($sJS)<br>执行某段js<br><br>3、$objResponse-&gt;addAssign("","","")<br>给页面中的某个元素附值，或者修改其属性<br>等等。。。。</p>
<p>所以xajax不是死的，它不能做出XXX XXX功能来，但是它可以灵活的控制客户端的js / vbs，去完成我们要实现的效果。</p>
<p>三、xajax安装配置<br><br>不需要特别的安装和配置，只要下载其文件包，解压到网站目录中<br>下载地址：<br><a href="http://www.xajaxproject.org/"><font color=#800080>http://www.xajaxproject.org/</font></a></p>
<p>三、用xajax做会员注册和登陆<br><br>1、数据库<br>采用mysql5.0，数据库名zl 表名zl_user&nbsp;&nbsp;&nbsp; 表结构<br>id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int(11)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; auto_increment<br>zl_user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varchar(50)<br>zl_pwd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varchar(50)<br>email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varchar(50)</p>
<p><a href="http://blog.knowsky.com/">http://blog.knowsky.com/</a></p>
<p>2、reg.php&nbsp;&nbsp;&nbsp; 注册文件(内有说明)</p>
<p>&lt;?php<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; require_once("inc/xajax.inc.php"); <br>//使用xajax则必须首先引入xajax.inc.php<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xajax = new xajax("inc/signup.php");<br>//创建一个xajax对象，为singup.php<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xajax-&gt;registerFunction("processForm");<br>//使用singup.php里的processForm函数<br>?&gt;<br>&lt;head&gt;<br>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&gt;<br>&lt;link rel="stylesheet" href="<a href="http://blogbeta.blueidea.com/css/style.css">http://blogbeta.blueidea.com/css/style.css</a>" _fcksavedurl=""<a href="http://blogbeta.blueidea.com/css/style.css">http://blogbeta.blueidea.com/css/style.css</a>"" type="text/css"&gt;<br>&lt;title&gt;无标题文档&lt;/title&gt;&nbsp;&nbsp;&nbsp;<br>&lt;?php $xajax-&gt;printJavascrīpt('inc/'); ?&gt;&nbsp;&nbsp;<br>&lt;scrīpt type="text/javascrīpt"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function submitSignup()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xajax.$('submitButton').disabled=true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xajax.$('submitButton').value="<a href="http://blogbeta.blueidea.com/wait">http://blogbeta.blueidea.com/wait</a>...";<br>//修改id为submitButton的属性<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xajax_processForm(xajax.getFormValues("signupForm"));<br>//这里xajax_ 后面跟要使用哪个函数这里是 processForm，后面跟的是signupForm这个表单各项的集合<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&lt;/scrīpt&gt;<br>&lt;/head&gt;<br>&lt;body&gt;&lt;form id="signupForm" action="javascrīpt:void(null);" ōnSubmit="submitSignup();"&gt;&nbsp;&nbsp;<br>&lt;div id="main"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id="m1"&gt;用 户 注 册&lt;/div&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id="formDiv"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;table width="100%" border="0" cellspacing="0" cellpadding="5"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="right"&gt; &lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="31%" align="right"&gt;用户名：&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="69%"&gt;&lt;input name="usr" type="text" id="usr" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="right"&gt;密码：&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input name="pwd" type="password" id="pwd" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="right"&gt;密码：&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input name="pwd2" type="password" id="pwd2" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="right"&gt;Email：&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input name="email" type="text" id="email" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 可用于找回密码&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr align="center"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td colspan="2"&gt;&lt;input type="submit" name="submitButton" value="提交" class="button" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type="reset" name="Submit2" value="重置" class="button" /&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/table&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br>&lt;/div&gt;<br>&lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p>
<p>点提交后执行singup.php里的processForm函数</p>
<p>3、inc/singup.php</p>
<p>&lt;?php<br>define ('XAJAX_DEFAULT_CHAR_ENCODING', 'gb2312' );<br>//注意这里，必须要设置gb2312，不然中文会乱码<br>require_once("xajax.inc.php"); <br>require_once("function.php");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>$xajax = new xajax();<br>$xajax-&gt;registerFunction("processForm");<br>//同reg.php文件</p>
<p>function processForm($aFormValues)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp; $objResponse = new xajaxResponse();<br>&nbsp;&nbsp;&nbsp;&nbsp; require_once("conn.php");&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; $usr=$aFormValues['usr'];&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; $email=$aFormValues['email'];<br>&nbsp;&nbsp;&nbsp;&nbsp; $pwd=$aFormValues['pwd'];<br>&nbsp;&nbsp;&nbsp;&nbsp; $pw=Md5($pwd);&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; $errmsg=""; <br>&nbsp;&nbsp;&nbsp;&nbsp; //要过滤的非法字符 <br>&nbsp;&nbsp;&nbsp;&nbsp; $ArrFiltrate=array("'",";","union");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($aFormValues as $key=&gt;$value){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (FunStringExist($value,$ArrFiltrate)){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAlert("输入的信息含有非法字符\"' ; union!\"");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","value","继续");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","disabled",false);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $objResponse;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (trim($usr) == "")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="请输入用户名!\n";&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (trim($pwd) == "")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="请输入密码!\n";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($pwd != $aFormValues['pwd2'])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="两次输入的密码不一致!\n";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!CheckEmailAddr($email))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="邮件地址不正确!\n";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql="select * from zl_usr where zl_usr='$usr'";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result=mysql_query($sql,$db); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($myrow=mysql_fetch_array($result)){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="用户名已经存在!\n"; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($errmsg=="")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sForm = "注册成功&lt;br&gt;用户名:".$usr."&lt;br&gt;email:".$email."";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql="insert into zl_usr(zl_usr,zl_pwd,email) values('$usr','$pw','$email')";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result=mysql_query($sql,$db);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("formDiv","innerHTML",$sForm);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAlert($errmsg);&nbsp;&nbsp;<br>//弹出错误信息<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","value","继续");<br>//修改submitButton的value为继续<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","disabled",false);<br>//修改submitButton这个按扭的属性<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $objResponse;<br>}</p>
<p><br>$xajax-&gt;processRequests();<br>?&gt;</p>
<p>这个文件中对信息进行了有效性判断，包括：用户名是否已经注册过、信息中是否有非法字符、邮件地址是否正确、两次输入的密码是否一致，如果没有错误则输入到数据库中，并<br>$objResponse-&gt;addAssign("formDiv","innerHTML",$sForm);<br>在formDiv中重新插入代码，内容为$sForm <br>$sForm = "注册成功&lt;br&gt;用户名:".$usr."&lt;br&gt;email:".$email."";</p>
<p>如果有错误信息则<br>$objResponse-&gt;addAlert($errmsg);&nbsp;&nbsp;<br>//弹出错误信息<br>$objResponse-&gt;addAssign("submitButton","value","继续");<br>$objResponse-&gt;addAssign("submitButton","disabled",false);<br>//修改submitButton这个按扭的属性</p>
<p>3、login.php 登陆文件</p>
<p>&lt;?php<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; require_once("inc/xajax.inc.php"); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xajax = new xajax("inc/login.php");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xajax-&gt;registerFunction("processForm");<br>?&gt;<br>&lt;head&gt;<br>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&gt;<br>&lt;link rel="stylesheet" href="<a href="http://blogbeta.blueidea.com/css/style.css">http://blogbeta.blueidea.com/css/style.css</a>" _fcksavedurl=""<a href="http://blogbeta.blueidea.com/css/style.css">http://blogbeta.blueidea.com/css/style.css</a>"" type="text/css"&gt;<br>&lt;title&gt;无标题文档&lt;/title&gt;&nbsp;&nbsp;&nbsp;<br>&lt;?php $xajax-&gt;printJavascrīpt('inc/'); ?&gt;&nbsp;&nbsp;<br>&lt;scrīpt type="text/javascrīpt"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function submitSignup()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xajax.$('submitButton').disabled=true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xajax.$('submitButton').value="<a href="http://blogbeta.blueidea.com/wait">http://blogbeta.blueidea.com/wait</a>...";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xajax_processForm(xajax.getFormValues("signupForm"));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&lt;/scrīpt&gt;<br>&lt;/head&gt;<br>&lt;body&gt;&lt;form id="signupForm" action="javascrīpt:void(null);" ōnSubmit="submitSignup();"&gt;&nbsp;&nbsp;<br>&lt;div id="main"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id="m1"&gt;用 户 登 陆&lt;/div&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id="formDiv"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;table width="100%" border="0" cellspacing="0" cellpadding="5"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="right"&gt; &lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="31%" align="right"&gt;用户名：&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="69%"&gt;&lt;input name="usr" type="text" id="usr" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="right"&gt;密码：&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input name="pwd" type="password" id="pwd" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr align="center"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td colspan="2"&gt;&lt;input type="submit" name="submitButton" value="提交" class="button" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type="reset" name="Submit2" value="重置" class="button" /&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/table&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br>&lt;/div&gt;<br>&lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p>
<p>4、inc/login.php&nbsp;&nbsp;&nbsp; 登陆用的处理文件</p>
<p>&lt;?php<br>define ('XAJAX_DEFAULT_CHAR_ENCODING', 'gb2312' );<br>require_once("xajax.inc.php"); <br>require_once("function.php");&nbsp;&nbsp;<br>$xajax = new xajax();<br>$xajax-&gt;registerFunction("processForm");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>function processForm($aFormValues)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp; $objResponse = new xajaxResponse();<br>&nbsp;&nbsp;&nbsp;&nbsp; require_once("conn.php");&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; $usr=$aFormValues['usr'];&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; $email=$aFormValues['email'];<br>&nbsp;&nbsp;&nbsp;&nbsp; $pwd=$aFormValues['pwd'];<br>&nbsp;&nbsp;&nbsp;&nbsp; $pw=Md5($pwd);&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; $errmsg=""; <br>&nbsp;&nbsp;&nbsp;&nbsp; //要过滤的非法字符 <br>&nbsp;&nbsp;&nbsp;&nbsp; $ArrFiltrate=array("'",";","union");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($aFormValues as $key=&gt;$value){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (FunStringExist($value,$ArrFiltrate)){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAlert("输入的信息含有非法字符\"' ; union!\"");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","value","继续");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","disabled",false);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $objResponse;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (trim($usr) == "")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="请输入用户名!\n";&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (trim($pwd) == "")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="请输入密码!\n";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql="select * from zl_usr where zl_usr='$usr' and zl_pwd='$pw'";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result=mysql_query($sql,$db); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!$myrow=mysql_fetch_array($result)){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $errmsg.="用户名不存在,或密码错误!\n"; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($errmsg=="")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sForm = "登陆成功";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("formDiv","innerHTML",$sForm);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAlert($errmsg);&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","value","继续");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $objResponse-&gt;addAssign("submitButton","disabled",false);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $objResponse;<br>}</p>
<p><br>$xajax-&gt;processRequests();<br>?&gt;</p>
<p>登陆于注册原理差不多，就不废话了：）</p>
<p>另外下面是两个用到的文件代码 conn.php&nbsp;&nbsp;&nbsp; function.php<br>conn.php</p>
<p>&lt;?php<br>$database="zl";//MYSQL数据库名<br>$db = mysql_connect("127.0.0.1", "root","123456");//MYSQL数据库用户名和密码<br>mysql_select_db($database,$db);<br>?&gt;<br>function.php</p>
<p>&lt;?php<br>&nbsp;&nbsp;&nbsp; function CheckEmailAddr($C_mailaddr) <br>{ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$", <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $C_mailaddr)) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true; <br>} <br>//是否存在数组中的值 <br>function FunStringExist($StrFiltrate,$ArrFiltrate){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach ($ArrFiltrate as $key=&gt;$value){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (eregi($value,$StrFiltrate)){ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false; <br>} <br>?&gt;</p>
<div style="DISPLAY: none">&nbsp;</div>
<img src ="http://www.phpweblog.net/kiyone/aggbug/6907.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-10-30 17:31 <a href="http://www.phpweblog.net/kiyone/archive/2009/10/30/6907.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP开源AJAX框架</title><link>http://www.phpweblog.net/kiyone/archive/2009/10/30/6906.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 30 Oct 2009 09:24:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2009/10/30/6906.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/6906.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2009/10/30/6906.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/6906.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/6906.html</trackback:ping><description><![CDATA[<p><strong>jQPie</strong> <br>这是一个扩展自jQuery，结合PHP的一个Ajax框架。支持XML，HTML和JSON handler。jQPie提供的功能包括： <br>利用$.getJSON方法简化来自PHP的请求和处理数据。 <br>利用$.(element).load方法注入PHP生成的html到某一页面元素中。 <br>利用$.jqpie方法直接从web页面调用PHP函数。在响应$.jqpie调用时从PHP函数反过来调用jQuery。</p>
<p><strong>phpmsajax</strong> <br>一组PHP文件用来支持在PHP Web应用程序中使用Microsoft AJAX Library。</p>
<p><strong>jsLINB</strong> <br>jsLINB 是一个完全的浏览器端javascrīpt解决方案，兼容大部分现代浏览器(IE6.0/IE7.0/firefox1.5 /firefox2.0/opera9/Safari2.0，Safari 缺乏测试)。它可以帮助程序开发者实现各种类型的RIA应用-在提供更加强大框架的同时更加易用。压缩的核心代码仅仅50k, 包括了javascrīpt类型检查，强制类型，精密且灵活的事件模型，自定义事件，observer和tie/untie， boxing/unBoxing/reBoxing模型，直接调用，dom生成，查询，遍历和操作，css 样式操作，css 类操作，dom属性操作，javascrīpt完美OO实现，javascrīpt线程，高级Ajax，强大的Drag Drop，超级控件(可在外观/模板/行为/数据模型四个维度上定制的标准控件，可完全自定义控件)等。</p>
<p><strong>My-BIC</strong> <br>My-BIC是一个易于使用，强大的Ajax/PHP框架。 <br>支持XML,JSON和TEXT的格式Ajax数据传输。支持EasyForms：调用一个函数就能取得Form中的所有值，并为你创建一个少许美化的查询串。ajaxObj.getForm ('formid')。 JSON客户端Encoding支持：利用该功能你就能够在客户端或服务器之间发送和接收经过JSON Encoding的数据。 网络断线保护：当服务器Down掉时My-BIC将帮助你删除请求并阻止产生更多的调用。内置Submission队列：所有的AJAX请求将会发送到正确的顺序中，所有请求都会被存储在队列中防止被覆盖。提供一个帮助你在运行期进行调试的可视化操作界面。</p>
<p><strong>aSSL</strong> <br>aSSL：SSL for Ajax。这个开源项目可用于那些需要SSL支持的Ajax应用中。</p>
<p><strong>PHPLiveX <br></strong>PHPLiveX是一个PHP类库可用于在web页面中使用Ajax调用PHP函数。它非常易于使用，在调用一个PHP函数不需要附加额外的功能，包含一个灵活地预加载属性，兼容IE, Opera, Mozilla, Firefox等浏览器。</p>
<p><strong>RSPA</strong> <br>RSPA是一个基于组件事件驱动的ajax框架适用于PHP4与PHP5。使用这个框架可以从客户端控制事件调用服务器端PHP class函数。也可以在服服务器端直接操作客户端对象。</p>
<p><strong>phpAjaxTags</strong> <br>phpAjaxTags是模仿著名Java标签库"AjaxTags"的一个PHP标记库。简单但强大，易于使用与安装。不需要编写js代码就能实现ajax功能。</p>
<p><strong>XAJAX</strong> <br>xajax 通过Javascrīpt直接调用PHP函数。它使用Javascrīpt stub来调用PHP脚本中的函数，对象方法，和类方法。服务器端响应由于xajax响应对象创建，该对象提供非常多的命令比如：给一个HTML元素赋值，显示一个警告对话框等。还支持自定义脚本输出。所有特定浏览器代码(如使用XMLHttpRequest)都是抽象的，并且发送各种数据类型到服务器端都非常容易实现。xajax提供多种配置选项目以便易于与现存web应用或框架相集成。它的Javascrīpt核心简洁明了，而且可以通过覆盖来支持更多的高级Javascrīpt功能。</p>
<p><strong>NanoAjax</strong> <br>NanoAjax是一个基于PHP5，面向对象(包括Javascrīpt和PHP)的AJAX框架。它使用JSON作为数据交换格式。NanoAjax能够把多个虚拟请求归结到一个正真的请求当中。整个框架非常小，并且易于使用。基于class的服务器端事件处理方式。</p>
<p><strong>Pear:HTML_AJAX</strong> <br>Pear:HTML_AJAX是一个相当成熟的Ajax框架, 使用JSON进行数据传输。內建丰富的例子，包括留言板、登录、grab&#8230;等等。</p>
<p><strong>Ajax Agent</strong> <br>Ajax Agent是一个非常易于使用(只需三行代码)，并且非常强大的开源框架用于快速构建AJAX或RIA应用程序。支持复杂的数据类型比如： associated arrays与object。使用JSON(Javascrīpt Object Notation)作为数据交换格式。</p>
<p><strong>AjaxAC</strong> <br>AjaxAC是一个PHP框架可用于开发/创建/生成AJAX应用程序。 特点如下： <br>1.所有应用程序代码全都包含在一个单独的class中(可以附带任何Javascrīpt包)。 <br>2.PHP文件/HTML页面的调用非常简洁。 <br>3.内置简化处理Javascrīpt事件的功能 <br>4.内置创建和处理subrequest的功能。 <br>5.可以自定义配置值，所以某些元素可以在运行期才被设置。 <br>6.没有杂乱的Javascrīpt代码塞满所调用的Html代码，所有事件都是被动态附加上的。 <br>7.易于与模板引擎相集成基于以上两点原因。 <br>8.易于挂钩(hook)现有的PHP classe或MySQL数据库以便从subrequest返回数据。</p>
<p><strong>AJASON</strong> <br>AJASON是一个基于PHP5的AJAX开发包。它具有以下特点： <br>1.PHP5与Javascrīpt代码完全采用面向对象开发。 <br>2.从Javascrīpt异步调用PHP函数与对象方法。 <br>3.能够在服务器与客户端之间交换复杂的数据类型像arrays与object (更确切地说是对象属性)。 <br>4.使用Javascrīpt回调函数来处理服务端响应。 <br>5.能够在客户端处理服务端的AJASON错误。</p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/6906.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2009-10-30 17:24 <a href="http://www.phpweblog.net/kiyone/archive/2009/10/30/6906.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>